13.07.2015 Views

Download pdf guide - VSN International

Download pdf guide - VSN International

Download pdf guide - VSN International

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

9.3 Exit from a control structure 107Setting option IPRINT=* in the PRINT statements stops the identifiers of the datastructure Corr being printed.9.3 Exit from a control structureThere are no labels and jumps in GenStat; however, the EXIT directive can be used tobreak out of control structures like loops and block-if structures. The CONTROL optionindicates the type of control structure that is to be exited (with default FOR). The NTIMESoption specifies how many of them to exit (default 1). The REPEAT option controlswhether you exit from a loop altogether (the default, REPEAT=no) or whether you go toENDFOR and then repeat the loop with the next set of parameters (REPEAT=yes). EXIThas a logical expression as its parameter to control whether or not the exit takes place;if the expression is omitted, the exit always takes place.9.4 PracticalRe-open the spreadsheet file Peru.gsh from Practical 8.2, and set up a pointercontaining all the columns. (Hint: in GenStat for Windows, you can do this by clickingon the Create Pointer sub-option of the Sheet option of the Spread menu.)Write a loop to print the mean and variance of every variate. (Hint: use the MEAN andVAR functions.)Add an if-block so that you use 4 decimals if variance

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!