Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Tokenize-a-string/XPL0/tokenize-a-string.xpl0
Normal file
20
Task/Tokenize-a-string/XPL0/tokenize-a-string.xpl0
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
string 0;
|
||||
include c:\cxpl\codes;
|
||||
int I, J, K, Char;
|
||||
char String, Array(5,6); \5 words and 5 maximum chars + terminating 0
|
||||
|
||||
[String:= "Hello,How,Are,You,Today";
|
||||
I:= 0; K:= 0;
|
||||
repeat J:= 0;
|
||||
loop [Char:= String(I);
|
||||
I:= I+1;
|
||||
if Char=^, or Char=0 then quit;
|
||||
Array(K,J):= Char;
|
||||
J:= J+1;
|
||||
];
|
||||
Array(K,J):= 0; \terminate word
|
||||
K:= K+1; \next word in array
|
||||
until K>=5;
|
||||
for K:= 4 downto 0 do [Text(0, addr Array(K,0)); ChOut(0, ^.)];
|
||||
CrLf(0);
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue