Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/String-length/Component-Pascal/string-length-1.pas
Normal file
14
Task/String-length/Component-Pascal/string-length-1.pas
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
MODULE TestLen;
|
||||
|
||||
IMPORT Out;
|
||||
|
||||
PROCEDURE DoCharLength*;
|
||||
VAR s: ARRAY 16 OF CHAR; len: INTEGER;
|
||||
BEGIN
|
||||
s := "møøse";
|
||||
len := LEN(s$);
|
||||
Out.String("s: "); Out.String(s); Out.Ln;
|
||||
Out.String("Length of characters: "); Out.Int(len, 0); Out.Ln
|
||||
END DoCharLength;
|
||||
|
||||
END TestLen.
|
||||
15
Task/String-length/Component-Pascal/string-length-2.pas
Normal file
15
Task/String-length/Component-Pascal/string-length-2.pas
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
MODULE TestLen;
|
||||
|
||||
IMPORT Out;
|
||||
|
||||
PROCEDURE DoByteLength*;
|
||||
VAR s: ARRAY 16 OF CHAR; len, v: INTEGER;
|
||||
BEGIN
|
||||
s := "møøse";
|
||||
len := LEN(s$);
|
||||
v := SIZE(CHAR) * len;
|
||||
Out.String("s: "); Out.String(s); Out.Ln;
|
||||
Out.String("Length of characters in bytes: "); Out.Int(v, 0); Out.Ln
|
||||
END DoByteLength;
|
||||
|
||||
END TestLen.
|
||||
Loading…
Add table
Add a link
Reference in a new issue