Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/String-concatenation/XPL0/string-concatenation.xpl0
Normal file
23
Task/String-concatenation/XPL0/string-concatenation.xpl0
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
func Concat(S1, S2, S3); \Concatenate strings: S3:= S1 + S2
|
||||
char S1, S2, S3;
|
||||
int C, I, J;
|
||||
[I:= 0;
|
||||
repeat C:= S1(I);
|
||||
S3(I):= C & $7F; \remove MSb terminator from first string
|
||||
I:= I+1;
|
||||
until C >= $80;
|
||||
J:= 0;
|
||||
repeat C:= S2(J);
|
||||
S3(I+J):= C;
|
||||
J:= J+1;
|
||||
until C >= $80;
|
||||
return S3;
|
||||
];
|
||||
|
||||
code Text=12;
|
||||
char A, B, C(80);
|
||||
[A:= "Hello";
|
||||
B:= " World!";
|
||||
Concat(A, B, C);
|
||||
Text(0, C);
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue