12.3 Cursor Object

Provides properties that let you manipulate the cursor.

12.3.1 Column property

Gives the cursor column position.

Syntax

object.Column

Type

Integer.

Attributes

Read/write.

Example

see example in Example.

See Also

12.3.2 Row property

Gives the row position of the cursor.

Syntax

object.Row

Type

Integer.

Attributes

Read-only.

Example

See example in Example.

See Also

12.3.3 Visible property

Sets cursor visibility.

Syntax

object.Visible[=Value As Boolean]

Type

Boolean.

Attributes

Read/write.

Remarks

Value is an optional parameter that sets the cursor to visible (TRUE) or not visible (FALSE). By default it set to be TRUE.

Example

See example in Example.

See Also

12.3.4 MoveTo method

Moves the cursor to the row, column location inside of the current window.

Syntax

object.MoveTo(
   Row As Integer, 
   Column As Integer)

Parameters

Row

The row to move the cursor to.

Column

The column to move the cursor to.

Return Values

Boolean. Returns TRUE if successful; otherwise, FALSE.

Example

This example generates a table of even numbers using all the properties and methods listed in the cursor object.

’Sample for displaying even numbers
Win.Define(5,10,15,30) 
Win.title = "Even number table"
Win.BackColor = WIN_BG_Cyan 
Win.Visible = True 
Win.TextWrap =TRUE
’Sets the cursor object
Set cursor = Win.Cursor
’Disables cursor visibility in the text window
cursor.visible =False
’Returns the current row position of the cursor  
i = cursor.row
’Returns the current column position of the cursor  
j = cursor.column  
’Draws a vertical double line at the set cursor position
i=1
Do While(i<10)
 j=4
 Do while(j<20)
  ’Moves the cursor to the set row and column coordinates
  cursor.moveto(i,j)
  Win.Textout(win.linedrawchar(3))
  j =j+4
 loop
 i=i+1
loop
’Draws a horizontal double line at the set cursor position
i=2
Do While(i<10)
 j =1
 Do While(j<20)
  cursor.moveto(i,j)
  Win.Textout(win.linedrawchar(1))
  j =j+1
 loop
 i=i+2
loop
’draws a horizontal cross to make a table at the set cursor
position
i=2
Do While(i<10)
 j =4
 Do While(j<20)
  cursor.moveto(i,j)
  Win.Textout(win.linedrawchar(39))
  j=j+4
 loop
 i=i+2
loop
’Displays the number at the set cursor position
 x=4 
 i=1
 Do While(i<10)
  j=2
  Do While(j<20)
   cursor.moveto(i,j)
   Win.Textout(Cstr(x))
   j=j+4
   x=x+2
  loop
  i=i+2
 loop
Wait 2000
Win.Close()

See Also