LOCATE statement

Purpose:

LOCATE moves the console mode screen cursor to the specified coordinates.

Syntax:

LOCATE Row AS INTEGER, _
    Column AS INTEGER  _
 [, Cursor AS INTEGER] _
 [, CursorSize AS INTEGER]

Parameters:

  • Data type: INTEGER
    Row vertical console mode screen position.
  • Data type: INTEGER
    Column horizontal console mode screen position.
  • Data type: INTEGER
    Cursor [OPTIONAL] If set to 0 the cursor will be hidden, If set to 1 it will be visible. Default is 1.
  • Data type: INTEGER
    CursorSize [OPTIONAL] number between 0 and 99 indicating size; 12 is a normal cursor, 49 is half size and 99 is full size.

Remarks:

👉 LOCATE works only in console mode programs.

Example:

LOCATE 5,10,1,99 : SLEEP(3000) ' 99 = Full
LOCATE 5,10,1,49 : SLEEP(3000) ' 49 = Half
LOCATE 5,10,1,12 : SLEEP(3000) ' 12 = normal(default)

BCX Console Sample Programs using the LOCATE statement.


BCX_PUSHCONSOLESIZE statement

Purpose:

BCX_PUSHCONSOLESIZE saves the current console X, Y size.

Syntax:

BCX_PUSHCONSOLESIZE

Return Value:

  • None.

Parameters:

  • None.

BCX_SETCONSOLESIZE statement

Purpose:

BCX_SETCONSOLESIZE sets a custom sized console.

Syntax:

BCX_SETCONSOLESIZE(CharsWidth AS INTEGER, CharsHeight AS INTEGER)

Return Value:

  • None.

Parameters:

  • Data type: INTEGER
    CharsWidth width in number of characters of custom size console.
  • Data type: INTEGER
    CharsHeight height in number of characters of custom size console.

BCX_POPCONSOLESIZE statement

Purpose:

BCX_POPCONSOLESIZE restores the last saved console X, Y size.

Syntax:

BCX_POPCONSOLESIZE

Return Value:

  • None.

Parameters:

  • None.

Example 1:

👉 One must start this demo from an already-opened command prompt window, to get the full benefit of the demo.

SUB MAIN
 BCX_PUSHCONSOLESIZE         ' Save a copy of the command prompt window size 
 BCX_SETCONSOLESIZE(40,10) ' Set a custom size 
 PAUSE                       ' Observe the new (smaller) size 
 BCX_POPCONSOLESIZE          ' Restore the original size 
END SUB