10 ms·
The hard-coding of the length of the "aff" string and/or re-use of the "s" (size) variable does indeed look odd: s := SIZE(String); aff := "Affirmative,
by e12e 11y ago
The hard-coding of the length of the "aff" string and/or re-use of the "s" (size) variable does indeed look odd:
s := SIZE(String);
aff := "Affirmative, Dave";
(...)
s := 17;
n := Unix.Write(sock, S.ADR(aff), s);
As far as I can gather from: https://github.com/norayr/voc/blob/master/src/lib/v4/Strings.Mod https://github.com/norayr/voc/blob/master/src/lib/v4/Strings... this implementation uses some kind of c strings (not familiar with Oberon in general, but I thought that the norm was something like Pascal strings?): "Strings provides a set of operations on strings (i.e., on string constants and character
arrays, both of which contain the character 0X as a terminator). All positions in
strings start at 0.
Strings.Length(s)
returns the number of characters in s up to and excluding the first 0X."
It would seem that:
s := String.Length(arr);
should be the sane equivalent to "s := 17;"