Terminal control/Positional read: Difference between revisions
m ({{omit from|GUISS}}) |
|||
Line 4: | Line 4: | ||
[[Terminal Control::task| ]] |
[[Terminal Control::task| ]] |
||
=={{header|BASIC}}== |
=={{header|BASIC}}== |
||
=={{header|Locomotive Basic}}== |
|||
<lang locobasic>10 LOCATE 3,6 |
|||
20 a$=COPYCHR$(#0)</lang> |
|||
=== {{header|ZX Spectrum Basic}} === |
=== {{header|ZX Spectrum Basic}} === |
Revision as of 19:27, 2 August 2011
Determine the character displayed on the screen at column 3, row 6 and store that character in a variable.
BASIC
Locomotive Basic
<lang locobasic>10 LOCATE 3,6 20 a$=COPYCHR$(#0)</lang>
ZX Spectrum Basic
<lang basic> 10 REM The top left corner is at position 0,0
20 REM So we subtract one from the coordinates 30 LET c$ = SCREEN$(5,2)</lang>
REXX
The REXX doesn't have any cursor or screen management tools, but some REXX interpreters have added the functionality via different methods.
<lang rexx>/*REXX program demonstrates reading a char at specific screen location.*/
row=20 /*point to row twenty. */ col=55 /*point co column fifty-five. */ howMany=3 /*read a trio of characters. */
stuff=scrread(row,col,howMany) /*this'll do it. */
other=scrRead(40,55,2) /*same thing, but for row forty. */</lang>