Page 1 of 1

Update Variable after Form closing/opening

Posted: Sat Apr 06, 2019 2:51 pm
by dlaurora
Hello everyone,

Do you know if there is any way to update a variable inside a form when it opens and close, like a counter variable to be used to know how many time the program has been used or to edit a number like 1000 and when we open the program it pas to 1001?

Re: Update Variable after Form closing/opening

Posted: Sat Apr 06, 2019 3:50 pm
by jvierra
You can change any variable on open and close by adding the changes to the form "Load" an "FormClosed" events. Just change and save the variable as needed.

Re: Update Variable after Form closing/opening

Posted: Sat Apr 06, 2019 5:51 pm
by dlaurora
So, if for example, create a variable. let say $count with a value of 1, and close the form, next time I open it, can change it to 2, and maintains the new value?

Not sure if below syntax it's correct.

Code: Select all

$formGeneradorCodigoQR_Load={
	$TextboxCount.text = $count
}

$formGeneradorCodigoQR_close = {
	$count = $count + 1
}

Re: Update Variable after Form closing/opening

Posted: Sat Apr 06, 2019 6:22 pm
by jvierra
You would have to save the value somewhere Variables in programs are not saved after a program closes.

Re: Update Variable after Form closing/opening

Posted: Sat Apr 06, 2019 6:52 pm
by dlaurora
Thank you for you advise, i will try to following this steps from https://www.sapien.com/blog/2018/03/22/ ... nal-files/

perhaps I can save the data into a txt file, update it each time it close and the get the last result once I open again the form, thanks!