X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=doc%2Fflow-control.texi;h=b396e1f3b183ba5e98fcea215f0e58c9e5c67fd2;hb=dff37440177a355bfc0cf9ff56428114e29f5106;hp=2c8eacd5977efe5c0c9577203e1825eb21a8277d;hpb=dbf12b0ee6a99119c6854a663184f8df4f4c5241;p=pspp diff --git a/doc/flow-control.texi b/doc/flow-control.texi index 2c8eacd597..b396e1f3b1 100644 --- a/doc/flow-control.texi +++ b/doc/flow-control.texi @@ -1,4 +1,4 @@ -@node Conditionals and Looping, Statistics, Data Selection, Top +@node Conditionals and Looping @chapter Conditional and Looping Constructs @cindex conditionals @cindex loops @@ -15,7 +15,7 @@ looping, and flow of control. * LOOP:: Repeat a block of code. @end menu -@node BREAK, DO IF, Conditionals and Looping, Conditionals and Looping +@node BREAK @section BREAK @vindex BREAK @@ -29,7 +29,7 @@ BREAK. @cmd{BREAK} is allowed only inside @cmd{LOOP}@dots{}@cmd{END LOOP}. @xref{LOOP}, for more details. -@node DO IF, DO REPEAT, BREAK, Conditionals and Looping +@node DO IF @section DO IF @vindex DO IF @@ -59,7 +59,7 @@ When @cmd{DO IF} or @cmd{ELSE IF} is specified following @cmd{TEMPORARY} (@pxref{TEMPORARY}), the @cmd{LAG} function may not be used (@pxref{LAG}). -@node DO REPEAT, LOOP, DO IF, Conditionals and Looping +@node DO REPEAT @section DO REPEAT @vindex DO REPEAT @@ -72,6 +72,7 @@ expansion takes one of the following forms: var_list num_or_range@dots{} 'string'@dots{} + ALL num_or_range takes one of the following forms: number @@ -82,13 +83,11 @@ num_or_range takes one of the following forms: different variables, numbers, or strings into the block with each repetition. -Specify a dummy variable name followed by an equals sign (@samp{=}) and -the list of replacements. Replacements can be a list of variables -(which may be existing variables or new variables or some combination), -numbers, or strings. When new variable names are -specified, @cmd{DO REPEAT} creates them as numeric variables. When numbers -are specified, runs of increasing integers may be indicated as -@code{@var{num1} TO @var{num2}}, so that +Specify a dummy variable name followed by an equals sign (@samp{=}) +and the list of replacements. Replacements can be a list of existing +or new variables, numbers, strings, or @code{ALL} to specify all +existing variables. When numbers are specified, runs of increasing +integers may be indicated as @code{@var{num1} TO @var{num2}}, so that @samp{1 TO 5} is short for @samp{1 2 3 4 5}. Multiple dummy variables can be specified. Each @@ -100,16 +99,28 @@ each dummy variable is substituted; the second time, the second value for each dummy variable is substituted; and so on. Dummy variable substitutions work like macros. They take place -anywhere in a line that the dummy variable name occurs as a token, -including command and subcommand names. For this reason, -words commonly used in command and subcommand names should not be used -as dummy variable identifiers. +anywhere in a line that the dummy variable name occurs. This includes +command and subcommand names, so command and subcommand names that +appear in the code block should not be used as dummy variable +identifiers. Dummy variable substitutions do not occur inside quoted +strings, comments, unquoted strings (such as the text on the +@cmd{TITLE} or @cmd{DOCUMENT} command), or inside @cmd{BEGIN +DATA}@dots{}@cmd{END DATA}. + +New variable names used as replacements are not automatically created +as variables, but only if used in the code block in a context that +would create them, e.g.@: on a @cmd{NUMERIC} or @cmd{STRING} command +or on the left side of a @cmd{COMPUTE} assignment. + +Any command may appear within DO REPEAT, including nested DO REPEAT +commands. If @cmd{INCLUDE} or @cmd{INSERT} appears within DO REPEAT, +the substitutions do not apply to the included file. If PRINT is specified on @cmd{END REPEAT}, the commands after substitutions are made are printed to the listing file, prefixed by a plus sign (@samp{+}). -@node LOOP, , DO REPEAT, Conditionals and Looping +@node LOOP @section LOOP @vindex LOOP @@ -158,6 +169,7 @@ condition on @cmd{END LOOP} will always execute at least once. If neither the index clause nor either condition clause is present, then the loop is executed MXLOOPS (@pxref{SET}) times. +The default MXLOOPS is 40. @cmd{BREAK} also terminates @cmd{LOOP} execution (@pxref{BREAK}). @@ -170,4 +182,3 @@ variable as the loop index. When @cmd{LOOP} or @cmd{END LOOP} is specified following @cmd{TEMPORARY} (@pxref{TEMPORARY}), the @cmd{LAG} function may not be used (@pxref{LAG}). -@setfilename ignored