Viewport.Open (method)

Syntax

Viewport.Open [title [,XPos,YPos [,width,height]]]

Description

Opens a new viewport window or switches the focus to the existing viewport window.

Comments

The Viewport.Open method accepts the following named :

 

Parameter

Description

 

title

Specifies a String containing the text to appear in the viewport's caption.

 

XPos, YPos

Specifies Integer coordinates given in twips indicating the initial position of the upper left corner of the viewport.

 

width,height

Specifies Integer values indicating the initial width and height of the viewport.

 

If a viewport window is already open, then it is given the focus. Otherwise, a new viewport window is created.

Combined with the Print statement, a viewport window is a convenient place to output debugging information.

The viewport window is closed when the BasicScript host application is terminated.

The following keys work within a viewport window:

 

Key

Scrolls

 

Up

Up by one line.

 

Down

Down by one line.

 

Home

To the first line in the viewport window.

 

End

To the last line in the viewport window.

 

PgDn

The viewport window down by one page.

 

PgUp

The viewport window up by one page.

 

Ctrl+PgUp

The viewport window left by one page.

 

Ctrl+PgDn

The viewport window right by one page.

 

Only one viewport window can be open at any given time. Any scripts with Print statements will output information into the same viewport window.

When printing to viewports, the end-of-line character can be any of the following: a carriage return, a line feed, or a carriage-return/line-feed pair. Embedded null characters are printed as spaces.

Example

Sub Main()

  Viewport.Open "BasicScript Viewport",100,100,500,500

  Print "This will be displayed in the viewport window."

  Sleep 2000

  Viewport.Close

End Sub

See Also

Viewport.Close (method)

More information

V