Help texts

Other discussions about CSPro
Post Reply
AriSilva
Posts: 259
Joined: July 22nd, 2016, 3:55 pm

Help texts

Post by AriSilva » September 9th, 2019, 8:53 am

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.
Best
Ari

aaronw
Posts: 190
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: Help texts

Post by aaronw » September 9th, 2019, 5:37 pm

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));
enddo;
For that reason I think the functions helps could mostly stay the same. Maybe another example could be added to the list type helps, https://www.csprousers.org/help/CSPro/lists.html?

Post Reply