C-PLOT

Scientific Graphics and Data Analysis

12.21.3. - Initial code



In the next lines of code you put in a title and a comment, and you have the opportunity to enter some code that will get called once.
char  *title = "Fit to a Line:   y = c + m * x";
char  *comment;
setup() {
        /*
        *  Shown is optional user initialization
        *  of prompts. Second argument must point
        *  to static storage.
        */
        set_prompt(0, "LINE");  /* Main prompt */
        set_prompt(1, "line");  /* Command-file prompt */
}
The character-pointer variable title should be initialized to the address of a string containing a short message that identifies the function. You can have embedded newlines within the string. The title will be printed each time the fit starts and will be displayed when you type the print version V command. The character pointer comment may be set to point to a string that will be included in the information printed with the sF command

The function setup() gets called shortly after the fit process starts. You can put one-time initialization code within. For example, the default prompt FIT> can be changed by the optional calls to the function set_prompt(). In this example the primary prompt is set to LINE> and the secondary prompt to line>.