Terminal control/Restricted width positional input/No wrapping: Difference between revisions
Terminal control/Restricted width positional input/No wrapping (view source)
Revision as of 09:48, 14 April 2022
, 2 years ago→{{header|XPL0}}
(Added XPL0 example.) |
|||
Line 406:
Text(0, Str);
]</lang>
=={{header|Yabasic}}==
<lang Yabasic>// Rosetta Code problem: http://rosettacode.org/wiki/Restricted_width_positional_input/No_wrapping
// by Galileo, 04/2022
clear screen
sub getInput$(r, c, long)
local text$, c$
c = c - 1
r = r - 1
print at(c, r);
do
c$ = inkey$
if c$ = "enter" break
if c$ = "backspace" then
text$ = left$(text$, len(text$) - 1)
print "\b ";
else
if len(text$) < long text$ = text$ + c$
end if
print at(c, r) text$;
loop
return text$
end sub
text$ = getInput$(3, 5, 8)
print at(1, 23) "You entered: ", text$</lang>
|