We have been shortlisted! We are delighted to be nominated for 5 Tech for Good awards for our work with South African charity Shout It Now. Read more here.
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.
Simul8 Professional 2014 has introduced the ability to copy local variables between sections of Visual Logic. This can be read about here: 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.