[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7 LM:Block Item

Once a block definition has been created (see section LM:Block Definition), elements can be added to the block with the LM:Block Item module. If all block items are not filled at run time, it says EMPTY.

Enter the Bunao expression in the Data field. Remember to enclose any literal string constants in double quotes (`"') or they will be interpreted. See Soft vs. Hard Newlines, for notes on entering line breaks in text boxes.

Use the Count field to set the number of times this line is inserted in the block. This allows multiple copies of the same line to be inserted in the same block with a single Block Item module.

Use the Location radiobutton to specify where in the block this item should go. Select Random to position the item randomly in any available space. To allow random placement with restrictions, enter a Buano/Tcl expression in the Restrictions field. Two predelcared variables are available for use in this field: `LOC' refers to the position that item is to occupy, and `BLKE' is the number of the last position. So, for example, an entry of `LOC <= (BLKE/2)' will ensure that this item is positioned in the top half of the list.

If the Count field was set to more than one, then the Separation field can be set to an integer which specifies a minimum distance between the multiple copies. By default it is `1', which allows multiple lines to be immediately adjacent.

Alternatively, the Specific radiobutton can be selected to position the item in a precise (ie, non-random) location. Enter a Bunao expression in the adjacent field for the position.

The Save Loc field takes the name of a variable to store the final position of this item in. Note that even if the location type was `Specific', this field is useful because it evaluates the location expression. For example, if `a+b' is entered as a specific location, and `c' for the save location, then after insertion the variable `c' will be equal to whatever `a+b' was at runtime.

LM:Block Item user interface:

images/lm-blockitem

module attribute list:
Attribute Type Default Description
data expression (blank) data to insert in the block
count integer `1' number of times to insert item in block
sep integer `1' minimum separation between multiple inserts
loctype random
specific
`random' insert randomly or at specified position
loc value (blank) location to insert item, if specific
restr expression (blank) restrictions on random location
storloc variable (blank) variable to store location used


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on October, 28 2005 using texi2html