From c2c9d5e9312b79217fbfc598ef31951dec869458 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 28 Nov 2020 11:11:11 +0100 Subject: [PATCH] Documentation: New example for the temporary command --- doc/automake.mk | 1 + doc/data-selection.texi | 39 +++++++++++++++++----------------- doc/pspp-figures/temporary.sps | 17 +++++++++++++++ 3 files changed, 37 insertions(+), 20 deletions(-) create mode 100644 doc/pspp-figures/temporary.sps diff --git a/doc/automake.mk b/doc/automake.mk index 65e2164220..2325e236a5 100644 --- a/doc/automake.mk +++ b/doc/automake.mk @@ -123,6 +123,7 @@ FIGURE_SYNTAX = \ doc/pspp-figures/independent-samples-t.sps \ doc/pspp-figures/reliability.sps \ doc/pspp-figures/split.sps \ + doc/pspp-figures/temporary.sps \ doc/pspp-figures/tutorial1.sps \ doc/pspp-figures/tutorial2.sps \ doc/pspp-figures/tutorial3.sps \ diff --git a/doc/data-selection.texi b/doc/data-selection.texi index 71b4e3de5a..17c039c88d 100644 --- a/doc/data-selection.texi +++ b/doc/data-selection.texi @@ -249,31 +249,30 @@ procedure-like commands. Scratch variables cannot be used following @cmd{TEMPORARY}. -An example may help to clarify: +@subsection Example Temporary -@example -DATA LIST /X 1-2. -BEGIN DATA. - 2 - 4 -10 -15 -20 -24 -END DATA. +In @ref{temporary:ex} there are two @cmd{COMPUTE} transformation. One +of them immediatly follows a @cmd{TEMPORARY} command, and therefore has +effect only for the next procedure, which in this case is the first +@cmd{DESCRIPTIVES} command. -COMPUTE X=X/2. +@float Example, temporary:ex +@psppsyntax {temporary.sps} +@caption {Running a @cmd{COMPUTE} transformation after @cmd{TEMPORARY}} +@end float -TEMPORARY. -COMPUTE X=X+3. +The data read by the first @cmd{DESCRIPTIVES} procedure are 4, 5, 8, +10.5, 13, 15. The data read by the second @cmd{DESCRIPTIVES} procedure are 1, 2, +5, 7.5, 10, 12. This is because the second @cmd{COMPUTE} transformation +has no effect on the second @cmd{DESCRIPTIVES} procedure. You can check these +figures in @ref{temporary:res}. -DESCRIPTIVES X. -DESCRIPTIVES X. -@end example +@float Result, temporary:res +@psppoutput {temporary} +@caption {The results of running two consecutive @cmd{DESCRIPTIVES} commands after + a temporary transformation} +@end float -The data read by the first @cmd{DESCRIPTIVES} are 4, 5, 8, -10.5, 13, 15. The data read by the first @cmd{DESCRIPTIVES} are 1, 2, -5, 7.5, 10, 12. @node WEIGHT @section WEIGHT diff --git a/doc/pspp-figures/temporary.sps b/doc/pspp-figures/temporary.sps new file mode 100644 index 0000000000..15828066e2 --- /dev/null +++ b/doc/pspp-figures/temporary.sps @@ -0,0 +1,17 @@ +data list notable /x 1-2. +begin data. + 2 + 4 +10 +15 +20 +24 +end data. + +compute x=x/2. + +temporary. +compute x=x+3. + +descriptives x. +descriptives x. -- 2.30.2