Page 1 of 1

Static variables in Breakouts

PostPosted: Mon Jun 02, 2014 12:00 pm
by jeromeh
In Jiwa 6.5.13 in the breakout script text for the 'Sales Order Entry' form in the 'Form GridLines Row Change' script what are the Static1 to Static6 representing. Specifically I want to know what Static2 is and if I can effect its value from a value stored in the database?

Re: Static variables in Breakouts

PostPosted: Fri Jun 06, 2014 7:08 pm
by Mike.Sheen
jeromeh wrote:In Jiwa 6.5.13 in the breakout script text for the 'Sales Order Entry' form in the 'Form GridLines Row Change' script what are the Static1 to Static6 representing. Specifically I want to know what Static2 is and if I can effect its value from a value stored in the database?


Hi Jerome,

Static1, Static2, etc are fairly redundant - they were originally intended to be variables you could set to pass information between breakouts. A more elegant and powerful solution is to simply declare a variable as public in the Form Loaded breakout - after the End Sub, and then you can reference that variable and the value will be persisted for all breakouts - so the scope is global

eg: in the Form Loaded breakout of sales orders:

Code: Select all
End Sub

Public myVariable


Then, in any breakout you can read and write into that variable.