9.18 Screen Object

Contains information about a specific screen and provides methods to let you manipulate that information.

9.18.1 Current property

Determines whether or not the displayed screen is the current screen.

Syntax

object.Current

Type

Boolean.

Attributes

Read-only.

Example

This example returns TRUE if the displayed screen is the current one; otherwise, FALSE.

set srv = CreateObject ("ucx:Server") 
set screens = srv.Screens 
Screens.Reset 
While(Screens.HasMoreElements=TRUE) 
     set screen = Screens.Next 
     If(Screen.Current=TRUE) Then 
          Print("Current screen's name is:" & Screen.Name) 
     End if 
Wend

9.18.2 Name property

Returns the name of the screen.

Syntax

object.Name

Type

String.

Attributes

Read-only.

Example

This example returns the name of the screen.

set srv = CreateObject ("ucx:Server") 
set screens = srv.Screens 
Screens.Reset 
While(Screens.HasMoreElements=TRUE) 
     set screen = Screens.Next 
     Print("Screen name is:" & Screen.Name) 
Wend

9.18.3 Text property

Displays the specified text on the screen.

Syntax

object.Text

Type

String.

Attributes

Read-only.

Example

This example displays the text of the screen.

set srv = CreateObject("ucx:Server") 
set screens = srv.Screens 
set screen = Screens.CurrentScreen 
     print("Text on current Screen:" & Screen.Text)

9.18.4 Read method

Returns the text of the screen with color information.

Syntax

object.Read()

Parameters

None.

Return Values

Byte[ ].

Example

This example returns the text of the screen with color information.

set srv = createobject ("ucx:Server") 
set screens = srv.Screens 
set screen=Screens.CurrentScreen 
ScreenBUF = Screen.Read 
set screen = Screens.Next 
Screen.Write(ScreenBUF)

9.18.5 Write method

Writes the text and color information in the buffer to the screen.

Syntax

object.Write( 
   buffer As byte[])

Parameters

buffer

The buffer to be displayed on the screen.

Return Values

Boolean. Returns TRUE if successful; otherwise, FALSE.

Example

This example writes the text and color information in the buffer into the screen.

set srv = createobject ("ucx:Server") 
set screens = srv.Screens 
set screen=Screens.CurrentScreen 
ScreenBUF = Screen.Read 
set screen = Screens.Next 
Screen.Write(ScreenBUF)