On 12-01-2024 16:20, Norman Dunbar via Ql-Users wrote:


If I remember correctly, all the way back to 1984-85, I'm almost certain that the supplied QL manual, in the large, heavy, A$ folder, mentioned that string lengths are indeed stored in a$(0)---or at least, can be accessed from there.

Cheers,
Norm.


Page 46 of the Concepts section mentions that 'under certain circumstances' it is possible to refer to more than one element in an array (i.e. slice the array), and that the term 'array' in this context can include a numerical array, a string array or a simple string. It also mentions that the slice (0 TO) means the full range of elements.

Whilst it is indeed possible to slice an array (which includes element 0), this is not true for simple strings. Using slice (0 TO) of a simple string always produces an 'out of range' error. Under Minerva and SMSQ/E, a$(0) indeed returns the length of a$. At least version JS returns an error when trying to access element 0 of a simple string.

--
Jan Bredenbeek | Hilversum, NL | j...@bredenbeek.net

_______________________________________________
QL-Users Mailing List

Reply via email to