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.

3.8 Unnamed data structures 33Lower and upper-case labels are distinguished, unless you set option CASE=ignored inthe POINTER statement. You can also set option ABBREVIATE=yes, to allow the labelsto be abbreviated. (By default, CASE=significant and ABBREVIATE=no.) So, if youhad specifiedPOINTER [NVALUES=labs; CASE=ignored; ABBREVIATE=yes]\employeeyou would be able to refer to employee['name'], for example, as employee['n']or employee['Name'].3.8 Unnamed data structuresIt can be wasteful and tedious to set up a structure explicitly when it is needed only oncein a program. So GenStat allows you to define an unnamed structure instead. Someparticularly useful types of unnamed structures are described below.The unnamed scalar is just a number. Whenever GenStat expects the identifier of ascalar, a number may be given instead. In fact, you have been using this type of unnamedstructure already: the statementVARIATE [NVALUES=10] xis equivalent toSCALAR [VALUE=10] nVARIATE [NVALUES=n] xHowever, the converse, that you can use a scalar instead of a number, is not always true.The exception is with pre-multipliers and post-multipliers when, as mentioned in Section3.7, the scalar must be preceded by the substitution symbol (#).The other forms all have a common style: they start with an exclamation mark, then atype code, and then a list enclosed in round brackets. An unnamed variate takes the form!V( list of numbers )where the letter V can be in either upper or lower case, or equivalently!( list of numbers )For exampleGRAPH rain; !(1...8)plots rain against day number, 1 to 8.The unnamed text takes one of two forms. If the text has a single value, then the valuecan be placed within quotes (') and used instead of the identifier of the text. Forexample:GRAPH [TITLE='Rainfall during my holiday'] rain; !(1...8)If there are several values, the form is!T( list of strings )where the letter T can be in either upper or lower case. For example:PRINT !t(Sat,Sun,Mon,Tues,Wed,Thur,Fri,Sat),rainThe unnamed pointer has the form!P( list of identifiers )where, again, the letter P can be in either upper or lower case.There are also unnamed expressions (type code E), and unnamed formulae (type codeF). Finally, type code S provides another way to specify an unnamed scalar.Unnamed structures are particularly useful when assigning values to several structures.The directives that are used to declare data structures all have a parameter as well as anoption to specify the values of the structures that are defined. (This is one of the few

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

Saved successfully!

Ooh no, something went wrong!