Page 1 of 1

Help texts

Posted: September 9th, 2019, 8:53 am
by AriSilva
Several new functions and behaviors were incorporated in the 7.3 version, for example, the use of lists.
Those are mentioned in the help of each function, as in the fileread, that can read all the file into a single list.
However, there is no example in the help texts to reflect that (and many many other new functions).
I would suggest increasing heavily the examples in the help, AND, writing some comments (//) to accompany the help text and explain what is being written in the cspro language.

Re: Help texts

Posted: September 9th, 2019, 5:37 pm
by aaronw
My initial thought is it may be more of a matter of understanding the list type then the function. The syntax doesn't really change. The behavior does change depending on the type of the parameter, but I think that is clearly stated.
    string line;
fileread(textFile, line);

list string allLines;
fileread(textFile, allLines);
The real difference is how you work with a string or list after the file has been read.
// Using a string we'll output 1 line
errmsg("%s", line);

// Using a list we'll output all lines
numeric size = allLines.length();
do numeric i = 1 while i <= size
errmsg("%s", allLines(i));
For that reason I think the functions helps could mostly stay the same. Maybe another example could be added to the list type helps,