Template Keywords
Miscellaneous - control
The /control/,keyword controls the way some keywords work in a script. Usually when you want to control the way a keyword works for as an exception. Sometimes the /control/ affects only the next keyword in the script, in other cases the entire template is affected.
/control/,<control type>,...
Depending on the control type there may be optional values on the line.
The control type can be one of these:
Add
This is used to do a numerical addition of the two previous values in the text buffer. In this example the explained and unexplained days absent are added together.
Example
/field/,attendance,0,0,0,0
/field/,reserved3,0,0,0,0
/control/,add
/text/,0,0,700,100,subtextTotal Days Absent ^
adjustpara
This is used to set the minimum height of a adjustable text frame that uses the newpara option. In this example each text frame will have a minimum height of 10 mm with an extra spacing of 2 tenths of a millimetre.
Example
/control/,adjustpara,2,100
div
This is used to do a numerical division of the previous value in the text buffer. In this example the course average which SM-Reports always calculates as a percent is divided by 2 to make it out of 50 for a 1 unit course.
Example
/field/,level21a,0,0,0,0
/control/,div,2
/text/,last,subtext^ / 50
keep
This affects the next /field/ or /column/ line by keeping only a part of the text in that field. For example, the extra circular activities done by a student are all entered into a single field in SM-Reports, but you want the items to print a separate lines on the report.
Examples
/control/,keep,1
/field/,reserved2,0,0,1800,50
/control/,keep,2
/field/,reserved2,0,50,1800,100
/control/,keep,3
/field/,reserved2,0,100,1800,150
Keep looks for commas to determine where to split the text. If you want to use a different character as the delimiter you can add it as an option, for example to have a semicolon.
/control/,keep,1,;
/field/,reserved2,0,0,1800,50
lowercase
This affects the next /field/, /column/ or /text/ line by converting the text to all lowercase. This is rarely used, but may have some use. See the uppercase option for a more useful option.
Example
/control/,lowercase
/text/,0,0,1800,70,This text will print in all LOWERCASE
pop
This gets the coordinates of the frame or offset from the last push. The first example gets the coordinates of the previous frame, and the second gets the offset. When popping frame coordinates the "stack" is a last in, first out list.
Examples
/control/,pop
/control/,pop,offset
push
This stores the coordinates of the previous frame or the current offset as in this example. The first example stores the coordinates of the previous frame, and the second stores the offset. When storing the frame coordinates they are stored in a "stack" which means you can push more than one set of frame coordinates.
Examples
/control/,push
/control/,push,offset
uppercase
This affects the next /field/, /column/ or /text/ line by converting the text to all uppercase.
Example
/control/,uppercase
/text/,0,0,1800,70,This text will print in all UPPERCASE