Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/Tokenize-a-string/PL-I/tokenize-a-string.pli
Normal file
23
Task/Tokenize-a-string/PL-I/tokenize-a-string.pli
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
tok: Proc Options(main);
|
||||
declare s character (100) initial ('Hello,How,Are,You,Today');
|
||||
declare n fixed binary (31);
|
||||
|
||||
n = tally(s, ',')+1;
|
||||
|
||||
begin;
|
||||
declare table(n) character (50) varying;
|
||||
declare c character (1);
|
||||
declare (i, k) fixed binary (31);
|
||||
|
||||
table = ''; k = 1;
|
||||
do i = 1 to length(s);
|
||||
c = substr(s, i, 1);
|
||||
if c = ',' then k = k + 1;
|
||||
else table(k) = table(k) || c;
|
||||
end;
|
||||
|
||||
/* display the table */
|
||||
table = table || '.';
|
||||
put skip list (string(table));
|
||||
end;
|
||||
end;
|
||||
Loading…
Add table
Add a link
Reference in a new issue