Literals/String: Difference between revisions

Content deleted Content added
m Moved to Basic learning cat
Line 20: Line 20:
STRING stringxyz = "xyz";
STRING stringxyz = "xyz";
FORMAT twonewlines = $ll$, threenewpages=$ppp$, fourbackspaces=$bbbb$;
FORMAT twonewlines = $ll$, threenewpages=$ppp$, fourbackspaces=$bbbb$;
Note: When only uppercase characters sets are available (eg on computers with only
The STRING type is actually a union of CHAR and FLEX array of CHAR.
6 bits per "byte") the single quote can used to denote a reserved word. eg
MODE STRING = UNION(CHAR, FLEX[]CHAR);
.PR QUOTE .PR
[]'CHAR' CHARXYZ = "XYZ";
The STRING type is simply a FLEX array of CHAR.
MODE STRING = FLEX[1:0]CHAR;
ALGOL 68 also has raw strings called BYTES, this type is a fixed width packed array of CHAR.
ALGOL 68 also has raw strings called BYTES, this type is a fixed width packed array of CHAR.
BYTES bytesabc = bytes pack("abc");
BYTES bytesabc = bytes pack("abc");