bas7ex.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CSRLIN Function Programming Example
                       Example                 Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
'This example uses the CSRLIN function to maintain the current cursor
'position with a SUB procedure that prints a message on the screen.
 
'Move cursor to center of screen, then print message.
'Cursor returned to center of screen.
LOCATE 12,40
CALL MsgNoMove("A message not to be missed.",9,35)
INPUT "Enter anything to end: ",A$
 
'Print a message without disturbing current
'cursor position.
SUB MsgNoMove (Msg$,Row%,Col%) STATIC
 
   'Save the current line.
   CurRow%=CSRLIN
   'Save the current column.
   CurCol%=POS(0)
   'Print the message at the given position.
   LOCATE Row%,Col% : PRINT Msg$;
   'Move the cursor back to original position.
   LOCATE CurRow%, CurCol%
 
END SUB