scripting:basic_syntax
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| scripting:basic_syntax [2014/06/07 17:17] – mit | scripting:basic_syntax [2025/05/28 16:34] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 101: | Line 101: | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | ===== Arrays ===== | ||
| + | |||
| + | Local, module and global arrays can be created. Arrays can contain values and text. Array indexing starts from 1, which is a bit annoying if you've got any sense at all but hey ho. | ||
| + | |||
| + | Arrays are declared and referenced as shown : | ||
| + | |||
| + | < | ||
| + | $maTestArray[] = | ||
| + | { | ||
| + | 100, " | ||
| + | 200, " | ||
| + | } | ||
| + | |||
| + | Event( "& | ||
| + | { | ||
| + | *say The first value in the array is $maTestArray[1] | ||
| + | *say The second text item in the array is $maTestArray[4] | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | .. which would print 'The first value in the array is 100' followed by 'The second text item in the array is Item 2'. | ||
| + | |||
| + | |||
| + | >> * [[Scripting: | ||
| + | |||
| + | |||
| + | |||
scripting/basic_syntax.1402161467.txt.gz · Last modified: (external edit)
