Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/User-input-Text/XPL0/user-input-text.xpl0
Normal file
15
Task/User-input-Text/XPL0/user-input-text.xpl0
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
string 0; \use zero-terminated strings, instead of MSb terminated
|
||||
include c:\cxpl\codes;
|
||||
int I;
|
||||
char Name(128); \the keyboard buffer limits input to 128 characters
|
||||
|
||||
[Text(0, "What's your name? ");
|
||||
I:= 0;
|
||||
loop [Name(I):= ChIn(0); \buffered keyboard input
|
||||
if Name(I) = $0D\CR\ then quit; \Carriage Return = Enter key
|
||||
I:= I+1;
|
||||
];
|
||||
Name(I):= 0; \terminate string
|
||||
Text(0, "Howdy "); Text(0, Name); Text(0, "! Now please enter ^"75000^": ");
|
||||
IntOut(0, IntIn(0)); CrLf(0); \echo the number
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue