[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

test[scripting] 100 - Local variables

"local initialization"
(ScriptParser new parse: ' | _aName index |
_aName := #aName.
 index := 0 
') evaluate = 0 ifFalse: [ self error: 'Must be 0' ]


"local use"
(ScriptParser new parse: '| index | index := 0.
    65 timesRepeat: [ index := index + 1. ].
    index asCharacter'
) evaluate = $A ifFalse: [ self error: 'Must be $A' ]