Amos Professional Manual  Contents  Index

Text


You may also change the position of the text cursor directly from inside a character string. This is ideal for positioning text once and for all on screen, no matter what happens in the program, because the text cursor can be set during the program's initialisation phase. The string that is returned takes the following format:

Chr$(27)+"X"+Chr$(48+X)+Chr$(27)+"Y"+Chr$(48+Y)

So whenever this string is printed, the text cursor will be moved to the text coordinates held by X and Y. For example:

E> A$="A"+At(10,10)+"Of"+At(2,4)+"String"+At(20,20)+"Pearls"
   Print A$

Imagine a Hi-Score table positioned like this:

E> SCORE=999
   Locate 12,10: Print "Hi Score ";SCORE

By using the AT function, the same table can be moved by editing a single string, no matter how many times it is used in the program, like this:

E> HI_SCORES=At(12,10)+"Hi Score"
   SCORE=999
   Print HI_SCORE$;SCORE

CENTRE
instruction: print text centrally on current line
Centre a$

Programmers often need to position text in the centre of the screen, and to save you the effort of calculating the text coordinates in order to achieve this, the CENTRE command takes a string of characters and prints it in the middle of the line currently occupied by the cursor. For example:

E> Locate 0,1
   Centre "ABOVE"
   Cmove ,3
   Centre "suspicion"

TAB$
function: move text cursor to next Tab
t$=Tab$

The TAB$ function returns a special control character called TAB, which carries the Ascii code of 9. When this character is printed, the text cursor is automatically moved to the next tabulated column setting (Tab) to the right.

Back    Next
05.06.07