📄 commands.c
字号:
{{s2sec <sec>} {Converts a (real) number of seconds into the listv {h mn s}.}} \{{2sec {yyyymmdd hhmmss}} {Converts a time to a number of seconds since 1970/01/01, 00h00.}} \{{sec2 <nsecs>} {Converts a number of seconds since 1970/01/01, 00h00 to a time of format {yyyymmdd hhmmss}.}} \{{sec} {Gets number of seconds since 1970/01/01, 00h00. This is the only action that takes into account milliseconds.}}}", "date",C_Date,"{\{{current [-l]} {Get local current date in the form yyyymmdd or if -l as a listv {dd mm yyyy}. If -g then gmt date is given.}} \{{2index <yyyymmdd>} {Gets the 'index' of the date <yyyymmdd>, i.e., number of days between 01/01/1900 and <yyyymmdd>}} \{{index2 <index>} {Gets the date corresponding to index <index>.}} \{{day <index>} {Gets the day (i.e., an integer from 0-sunday to 6-saturday) corresponding to the date of index <index>.}}}", "prand",C_PRand,"{{{<size> <mean>} {Returns a signal of size <size> made of i.i.d. Poisson variables of mean <mean>.}}}", "randinit",C_RandInit,"{{{[<init>]} {Initializes the random generator. If <init> is not specified it initializes it using the computer time. If not, it must be a positive \integer.}}}", /* * CProcs in int_expr.c */ "setv",C_Setv,"{{{[*var* | *list_of_var*] [[:*+/-^]=] <value> [-l <level>]} {This is the main evaluator command. The command 'a+=b' is equivalent to \'setv a += b' and 'a=b' is equivalent to 'setv a = b' or also 'setv a b'. The only advantage of the 'setv' syntax is that it lets you specify \a <level> in which the evaluation takes place (not the assignement !!).}}}", "info",C_Info,"{{{<value>} {Prints info on a value.}}}", "print",C_Print,"{{{<value1> [-s | <value2> ... <valueN>]} {Prints one or seveal values. Option '-s', prints it the 'short' way.}}}", "val",C_Val,"{{{test *exprString* [<&type>] [-l <level>] [-E]} {Returns the listv '{<type> <result>}' if the *exprString* evaluates successfully to <result> (which must \be of type <&type> if argument <&type> is specified). If evaluation is not successfull it returns 'null' unless '-E' is set in which case it generates an error. \Option '-l' lets you specify a level in which evaluation takes place.}} \{{eval <val> [-l <level>]} {Evals the value <val> and returns it.}} \{{type <val> [-b] [-l <level>]} {Returns the type of <val>. If '-b' then the 'basic' type is returned, e.g., &signal is returned instead of &signali. Option '-l' lets you specify a level in which evaluation takes place.}}}", /* * CProcs in int_controls.c */ "if", C_If, "{{{<test> <thenScript> [elseif <test1> <thenScript1> ..... elseif <testN> <thenScriptN> else <elseScript>]} \{The standard 'if then else' control. WARNING: each memeber of the <test> is evaluated (even if || or && clause).}}}", "for", C_For,"{{{<startScript> <continueValue> <nextScript> <bodyScript>} {The 'for' control loop. \The <startScript> is executed just once at the beginning of the loop. The loop is continued while <continueValue> is evaluated \to a number different from 0. The <nextScript> is executed at the end of each loop (just before <continueTest> is evaluated) \and <bodyScript> is the core of the loop.}}}", "foreach", C_Foreach,"{{{<var> (<list> | <listv> | <signal> | <range>) <bodyScript>} {The variable <var> loops successively on each element of the <list>, <listv> \<signal> or <range> till \its end is reached. After each assignation <bodyScript> is executed.}}}", "while",C_While,"{{{<continueTest> <bodyScript>} {The standard 'while' control loop. At the begining of each loop, \<continueTest> is evaluated using '=', if it returns 0 then the loop stops otherwise <bodyscript> is executed and the loop goes on.}}}", "do",C_Do,"{{{<bodyScript> <continueTest>} {The standard 'do' control loop. At the end of each loop, \<continueTest> is evaluated using '=', if it returns 0 then the loop stops otherwise <bodyscript> is executed and the loop goes on \(thus <bodysScript> is always executed at least once).}}}", "break", C_Break,"{{{} {Gets immediately out of any 'do', 'while', 'for' or 'foreach' loop.}}}",/* "return", C_Return,"{{{[*value*]} {Exits right away from a script procedure and returns *value* (not evaluated) if specified otherwise it returns the null pointer.}}}", */ "return", C_Returnv,"{{{[<value>] [-e]} {Exits right away from a script procedure and returns <value> if specified otherwise it returns the null pointer. If option '-e' is on, <value> is not evaluated.}}}", "continue", C_Continue,"{{{} {Skips directly to the next loop of a 'for', 'foreach', 'while' or 'do' loop.}}}", /* * CProcs in int_streams.c */ "getchar",C_GetChar,"{{{[*var*] [<delay>=-1]} {Reads from stdin a character and returns it or sets it in variable *var* if specified. If <delay> is non negative then the function returns after <delay> seconds. If no character was typed '0x0' is returned.}}}", "getline",C_GetLine,"{{{[*var*]} {Reads from stdin a line (ended by a newline or an eof) and returns it or sets it in variable *var* if specified.}}}", "scanf",C_Scanf,"{{{<format> [*var1* ... *varN*]} {Same syntax as 'scanf' in C-Language : reads arguments from stdin according to <format> and puts them in the variables *var1*...*varN*. \Warning : Most of the '%' C-format can be used (but not too complex ones !).}}}", "sscanf",C_SScanf,"{{{<string> <format> [*var1* ... *varN*]} {Same syntax as 'sscanf' in C-Language : reads arguments from <string> according to <format> and puts them in the variables *var1*...*varN*. \Warning : Most of the '%' C-format can be used (but not to complex ones !).}}}", "terminal",C_Terminal,"{{{movewindow <x> <y>} {Moves terminal window to position <x> <y> (Warning : only on Macintosh computers).}} \{{flush} {Flushes the terminal and all the display).}} \{{setfont <fontName>} {Set the font of the terminal).}} \{{getsize} {Get the width and height of the terminal window.}} \{{resizewindow <w> <h>} {Resizes terminal window using <w> <h> (Warning : only on Macintosh computers).}} \{{eraseline} {Erases current terminal line.}} \{{erasechars [<nChars>=1]} {Erases <nChars> characters from cursor position on current terminal line.}} \{{movecursor <nSpaces>} {Moves cursor <nSpaces> forward (>0) or backward (<0) from cursor position.}} \{{prompt [<promptProc>]} {If no argument it gets the current prompt otherwise it sets the procedure that is supposed to return the prompt string.}} \{{cursor <position>} {Sets the cursor to an absolute position on the current terminal line.}} \{{insert <string>} {Inserts a string on current terminal line from cursor position.}} \{{beep} {Just makes the terminal beep.}} \{{clear} {Clears the terminal.}} \{{line [<str>]} {Gets/Sets the current terminal line.}} \{{mode} {Gets the current mode of the terminal. It is either : 'getchar' (while the terminal waits for a single character), 'scanline' \(while the terminal waits for a whole line to be typed in but not for a command line), 'command' (when the terminal waits for a \command line to be typed in, in front of the prompt).}} \{{eof} {Sends an 'eof' character to the terminal.}}}", "printf",C_Printf,"{{{<format> [<val1> ... <valN>]} {Same syntax as 'printf' in C-Language : prints on stdout the values <val1>...<valN> according to <format>. \Warning : Most of the '%' C-format can be used (but not to complex ones !). Moreover two other formats '%V' (resp. '%v') can be used to print the long (resp. short) string representation \of a value.}}}", "sprintf",C_SPrintf,"{{{*var* <format> [<val1> ... <valN>]} {Same syntax as 'sprintf' in C-Language : sets variable *var* according to <format> with string variables <val1>...<valN>. \Warning : Most of the '%' C-format can be used (but not to complex ones !). Moreover two other formats '%V' (resp. '%v') can be used to print the long (resp. short) string representation \of a value. It returns the formatted string.}}}", "errorf",C_Errorf,"{{{<format> [<val1> ... <valN>]} {Same as 'printf' but prints on stderr instead of stdout and generates an error right after printing.}}}", "file",C_File,"{{{cd [<directory>]} {Changes/gets the working directory.}} \{{info <file>} {Returns a 2 element listv. The first element is the type of the file (either 'directory', 'file' or 'unknown') and the second is its size. If the file does not exist it returns null. (WARNING : the size is wrong on Macintoshes.)}} \{{createdir <path> <dirName>} {Creates a directory named <dirName> in directory <path>.}} \{{list <regexp>} {Returns the listv of filenames whose filename matches <regexp>.}} \{{listp <regexp>} {Same as 'list' but returns complete paths.}} \{{tmp} {Gets a filename that does not exist and that can be used for a temporary file.}} \{{remove <filename>} {Removes a file.}} \{{move <filenameSrc> <filenameTarget>} {Changes the name of a file.}} \{{open <filename> ('r' | 'w' | 'a')} {Opens a file in a 'r'ead, 'w'rite or 'a'ppend mode and returns a stream number associated to that file.}} \{{exist <filename> [<mode>='r']} {Tests whether a file named <filename> could be opened using mode <mode>.}} \{{openstr <str>} {Opens a stream associated to a string. It returns the stream number.}} \{{close <stream>} {Closes a stream.}} \{{eof [<stream>=stdin]} {Returns 1 if <stream> has reached an end of file.}} \{{set (stdin | stdout | stderr) [<stream>]} {Gets or Redirects 'stdin', 'stdout' or 'stderr' streams.}}}", /* * CProcs in int_eval.c */ "apply",C_Apply,"{{{listv [<level>=0] <proc> <listv>} {Apply the procedure <proc> with the argument list being the successive values of the <listv> . \If <level> is specified (and not 0) then the procedure is executed in a different level (not in the current level.}} \{{args [<level>=0] <proc> <arg1> ... <argN>} {Apply the procedure <proc> with the specified arguments. \If <level> is specified (and not 0) then the commands is executed in a different level (not in the current level.}}}", "eval",C_Eval,"{{{[<level>=0] <script>} {It evals the script in the current level. \If <level> is specified (and not 0) then the script is evaluated in a different level (not in the current level).}}}", /* * CProcs in int_alloc.c */ "listv",C_Listv,"{{{map <listv> <proc>} {Maps the procedure <proc> on each element of <listv> and returns \the listv of the results. The procedure <proc> should take one argument and return a value that will be inserted \in the result listv. If it does not return anything, nothing is insterted in the listv}} \{{read (<filename> | <stream>)} \{Read a listv (and return it) from file which has been created using the 'listv write' command.}} \{{cread (<filename> | <stream>) list_of x|s|?|f|F -n <nLinesToRead> -f <firstLine> -s <headerLinesSkipped> -S <separators> -c <commentChar>} \{Read an ascii file organized in columns into a listv (column separators are new lines, tabs or spaces). \Each element of the so-obtained listv corresponds to a read column. \Each read column is stored either into a listv (made of strings and/or floats) or into a signal. \For each column in the file \one must specify either the letter 'x' (for skipping the column), the letter 's' (in case of a column made exclusively of strings), \the letter 'f' \(for a column made exclusively of floats), the letter 'F' \(for a column made exclusively of floats that will be stored as a signal) or the sign '?' for the \command to choose either 'f' or 's' for each occurence. \The option '-n' allows to specify the number of lines to load into the listv. \The option '-f' allows \to specify the number of valid lines to skip (that does not include the eventual header lines). The option '-s' allows to \specify the number of lines to skip at the begining of the file (e.g., header). To change seprators characters use the option -S (passing a string including \all the separator characters you want except new lines).}} \{{write <listv> (<filename> | <stream>) -a} \{Write the content of a listv that is made exclusively of strings, floats, signals, images or listv's into a file so that it can be read \by the 'listv read' command. By default, the numbers are stored in binary format. If '-a' is specified, ascii coding is used for all the numbers.}} \{{cwrite <listv> (<filename> | <stream>) -s <separatorString> -f <listvFormat>} \{Write the content of a listv that is made of signals or (float/string) listv's of the same length into a multicolumn file. \By default the column are separated using tabs. It can be change using the '-s' option. \The option '-f' allows to specify a format for each column. <listvFormat> must be a listv made of strings (one for each column). \The strings are standard printf formats (starting with a % sign). If a string is empty default format (the one used when the option '-f' \is not used) will be used.}} \{{niceprint <listv> [<colSize>]} {Prints each element of the listv using tabulated columns.}} \{{sort <listv> [<proc>] [-i]} {Returns the sorted listv. the flag '-i' just reverse the resulting listv. \If no <proc> are given, the <listv> must be composed either only of numbers (the sorting is then performed in the increasing order) \or only by strings (the sorting is alphabetical). An error occurs in any other case. If <proc> is specified, it is supposed to be \the comparaison procedure. It must take 2 arguments arg1 and arg2 and must return an integer (negative if arg1<arg2, 0 if arg1==arg2 \and positive otherwise}}}", "list",C_List,"{{{Old LastWave 1.7 command} {Not to be used.}}}", "str",C_Str,"{{{inter <str> <str1>} {Get the common substring which starts both strings}} \{{match <str> <regexp> [<nOcc>=-1]} {Tests whether some substrings of <str> match the <regexp>. It returns a listv of ranges which correspond to \non overlapping maximal substrings which match the <regexp>. <nOcc> is the maximum number of occurence it should return (if negative then all are returned). \The wild cards characters for regexp are \n\^: beginning of string \n\$: end of string \n\?: a single character \n\+: one character or more \n\*: zero character or more \n\[+...]: one character (or more) that follows \n\[+^...]: one character(or more) that is different from the characters that follow \n\[#...]: zero or one character that follows \n\[#^...]: zero or one that is different from the characters that follow \n\[*...]: zero character (or more) that follows \n\[*^...]: zero character(or more) that is different from the characters that follow \n\|...|: range delimiters \n\!...!: escaped sequence}} \{{substr <str> <substr> [<nOcc>=-1]} {Same as action 'match' but optimized in the case the <regexp> is a simple string with no wild card.}} \{{2ascii <str>} {Gets a listv made of the ascii codes corresponding to the characters of the string <str>.}} \{{ascii2 <listv_of_codes>} {Gets the string associated to a listv of ascii codes (this action is the reverse action of the 'ascii' action).}}}", /* * CProcs in int_procs.c */ "setsourcedirs",C_SetSourceDirs,"{{{[<listv of directories>]} {Sets/Gets the list of directories the 'source' command looks a file in.}}}", "choosestartupscriptdir",C_ChooseStartupScriptDir,"{{{} {Picks up a script directory to use at startup.}}}", "choosefile",C_ChooseFile,"{{{} {Pops up a file dialog to pick up a file that exists. Returns the filename.}}}",
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -