Local Variables

Any Global Data Item declared in the Information Store is global. That is it can be read and written to by any Visual Logic section. This is generally fine but sometimes can be a restrictive so Simul8 now has local variables.

It is possible to copy sections of Visual Logic that contain Local Variables for more information see Copy Local Variables

A local variable only exists within the Visual Logic section that it is declared in. Once that block ends the variable is cleared and its values lost. A local variable of the same name can be declared elsewhere and will be treated as a different variable. The same local variable can even be used in multiple sections of code and each occurrence will have a distinct value.

When a section of Visual Logic is opened, a local variable can be assigned using the Local Variable button at the bottom of the window.

See Also