Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
7
Task/String-length/ALGOL-68/string-length-1.alg
Normal file
7
Task/String-length/ALGOL-68/string-length-1.alg
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
BITS bits := bits pack((TRUE, TRUE, FALSE, FALSE)); # packed array of BOOL #
|
||||
BYTES bytes := bytes pack("Hello, world"); # packed array of CHAR #
|
||||
print((
|
||||
"BITS and BYTES are fixed width:", new line,
|
||||
"bits width:", bits width, ", max bits: ", max bits, ", bits:", bits, new line,
|
||||
"bytes width: ",bytes width, ", UPB:",UPB STRING(bytes), ", string:", STRING(bytes),"!", new line
|
||||
))
|
||||
7
Task/String-length/ALGOL-68/string-length-2.alg
Normal file
7
Task/String-length/ALGOL-68/string-length-2.alg
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
STRING str := "hello, world";
|
||||
INT length := UPB str;
|
||||
printf(($"Length of """g""" is "g(3)l$,str,length));
|
||||
|
||||
printf(($l"STRINGS can start at -1, in which case LWB must be used:"l$));
|
||||
STRING s := "abcd"[@-1];
|
||||
print(("s:",s, ", LWB:", LWB s, ", UPB:",UPB s, ", LEN:",UPB s - LWB s + 1))
|
||||
Loading…
Add table
Add a link
Reference in a new issue