28 3 SyntaxString tokens can always be abbreviated to four characters. So, to save space, you will seethat we only specify four for the defaults in the syntax definitions. (The full rules forabbreviations like these are given in Section 3.3.)Other options and parameters, like the VALUES option of the TEXT directive, allow youto specify arbitrary strings: for exampleTEXT [VALUES='Last Sunday',Monday,Tuesday,Wednesday,\Thursday,Friday,Saturday,Sunday] dayIn general, these arbitrary strings are enclosed in single quotes ('). However, in a stringlist, the quotes can be omitted provided the string starts with a letter, and then containsonly letters and/or digits. A letter in GenStat is any of the capital letters A to Z, or thelower case letters a to z, or the underscore character (_), or percent (%), while a digit isone of the numerical characters 0 up to 9. (Note, though, the string tokens in GenStat aredefined so that they always start with a letter and contain only letters and/or digits, so youwill never need to put them inside quotes.)If you have a line break inside a quoted string, GenStat terminates the current string,and then begins a new one on the next line. So'These are the lastwords I have to say'is the same as'These are the last','words I have to say'If you want to continue a string on the next line, you must give a continuation character(\).You can include any characters inside a quoted string but, if you want to include asingle quote ('), a double quote (") or a continuation character (\), you must put themtwice. Otherwise a single quote on its own would terminate the string, a double quotewould begin a comment (so all the following characters would be ignored until the nextdouble quote), and a continuation character would continue the string onto the next line.Finally, there are lists of identifiers, as in the STRUCTURE parameter of PRINT: forexamplePRINT STRUCTURE=name,pay,hours,rateAn identifier is the name given to a data structure. It must start with a letter and thencontain only letters or digits. Only 32 characters are stored, sosatotal_software_sales_in_January_2008 will not be distinguished fromtotal_software_sales_in_January_2009 (both will be stored astotal_software_sales_in_January_). However, upper case is distinguished fromlower case, so SALES and Sales are not the same. (It is possible to change this using theSET directive, but this is not customary. You can also use SET to request that GenStatstores and checks only the first eight characters of identifiers, as was the case in theFourth and earlier Editions.) Identifiers can also have suffixes, enclosed in squarebrackets: for example x[2] or employee['grade']. These are explained in Section3.7.Any list may contain missing values, each represented by an asterisk (*). Theserepresent unknown (or unset) information.You can put comments anywhere in a statement, or between two statements.Comments begin and end with the double-quote character ("); between the quotes youcan type anything you like.
3.2 Making lists more compact3.2 Making lists more compact 29The values of any data structure can be substituted into a list of the appropriate type,using the substitution symbol hash (#). So, for example, values of variates can besubstituted into number lists:VARIATE [VALUES=1,2,3,4] xVARIATE [VALUES=#x,#x] xxgives xx eight values (1,2,3,4,1,2,3,4).Similarly, values of texts can be substituted into lists of strings. For example, inTEXT [VALUES=data,errors] pdeREAD [PRINT=#pde] day,rainthe PRINT option of READ is given the setting data,errors.Lists of numbers that increase or decrease in a regular way can be representedconveniently in GenStat as progressions. These have the general formx, y ... zwhere x is the first number, y the second number, and z the final limit. You can put spacesanywhere within this construct except within the sequence of three dots (...). Theprogression generates a sequence of numbers:x, x + s, x + 2s as far as x + kswhere s is the difference between y and x (so x + s = y) and k is the largest integer suchthat x + ks does not go beyond z. The step can be either positive or negative and need notbe an integer. If the step is 1 or 1, the second number y can be omitted. For example1...5 = 1,2,3,4,55...12,4...10==5,4,3,2,12,4,6,8,102,(4...10) = 2,4,5,6,7,8,9,10Notice that the progression in the final example must be placed in brackets to make itclear that the second number has been omitted.Lists of numbers, strings, or identifiers that are repeated in a regular way can becompacted using multipliers.A pre-multiplier precedes a bracketed list and repeats the individual elements of thelist, in turn, a specified number of times. For example3(1,2) = 1,1,1,2,2,2Post-multipliers come after a bracketed list of numbers and repeat the entire list, enbloc, the specified number of times. For example(day,temp,rain)2 = day,temp,rain,day,temp,rainThey may be combined. For example2((1...3)2,4) = 1,1,2,2,3,3,1,1,2,2,3,3,4,4You can use scalars as pre-multipliers or post-multipliers but you must also use asubstitution symbolSCALAR [VALUE=3] nplotFACTOR [LEVELS=4; VALUES=#nplot(1),(2,3,4)#nplot] blockgives block the values1,1,1, 2,3,4, 2,3,4, 2,3,4