Refreshing Variable for a timed event

Issues related to label design (working with databases, data processing, RFID encoding etc.) and printing (from NiceLabel Express, NiceLabel Pro, NiceForm and NicePrint)

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
PVLabel
Newcomer
Posts: 4
Joined: Fri Oct 11, 2019 4:48 pm

Refreshing Variable for a timed event

Post by PVLabel » Sat Nov 23, 2019 5:26 pm

Hi y'all,
I have NiceLabel 2019 Powerform edition and I been working on the forms solution to make a message window appear after the user clicks print and a 2 minutes have past. I been able to get a time difference but for some reason the variable stay the same until you leave the form for a different one. My only solution has been to re-open the form but I was wondering if anyone had any other solution that doesn't require me completely reopen the form.
Attachments
message window.png
this has been the debugging window I been using to see the variables not changing.
message window.png (7.86 KiB) Viewed 130 times

highfrost
Enthusiast
Posts: 17
Joined: Tue Aug 19, 2014 10:51 am

Re: Refreshing Variable for a timed event

Post by highfrost » Mon Nov 25, 2019 3:16 pm

Hi PVlabel,

In Nicelabel variables are static so you have to update them.
Can you tell how and where you update your variables?

I assume you do something like the following:
On form event every xxx miliseconds
if (offset(now, lastPrinttime) < 2) then Popup

On print event
set variable lastPrinttime= now

User avatar
Mytch
NiceLabel Support
NiceLabel Support
Posts: 103
Joined: Fri Jul 13, 2018 10:26 pm
Location: Milwaukee, Wisconsin
Contact:

Re: Refreshing Variable for a timed event

Post by Mytch » Mon Nov 25, 2019 6:28 pm

highfrost is correct. :)

Once you set a variable in NiceLabel, it will remain at that value until cleared or set again. It sounds like you might be using the Form Inactivity or On Timer Event to trigger some Actions. In this case, perhaps you can just add a Set Variable Action on top, as to first set your relevant value to be blank prior to additional logic. This may or may not fit your workflow and logic.

Btw as a tip, you can clear many or all variables at once by using the String Manipulation action. See below:
screenshot_07.jpg
screenshot_07.jpg (67.33 KiB) Viewed 109 times
Regards,
Mytch

PVLabel
Newcomer
Posts: 4
Joined: Fri Oct 11, 2019 4:48 pm

Re: Refreshing Variable for a timed event

Post by PVLabel » Tue Nov 26, 2019 8:52 pm

highfrost wrote:
Mon Nov 25, 2019 3:16 pm

In Nicelabel variables are static so you have to update them.
Can you tell how and where you update your variables?
The pop up happen every time someone clicked print and that message would pop up that has loaded the variables.

I had wrote a script that would use the VBscript that would take the computer clock take the time difference between and give it a value, I didn't realize that there was a form inactivity or on timer event. I will check those events out.

Thank you! I'll try it out.

PVLabel
Newcomer
Posts: 4
Joined: Fri Oct 11, 2019 4:48 pm

Re: Refreshing Variable for a timed event

Post by PVLabel » Tue Nov 26, 2019 8:52 pm

highfrost wrote:
Mon Nov 25, 2019 3:16 pm

In Nicelabel variables are static so you have to update them.
Can you tell how and where you update your variables?
The pop up happen every time someone clicked print and that message would pop up that has loaded the variables.

I had wrote a script that would use the VBscript that would take the computer clock take the time difference between and give it a value, I didn't realize that there was a form inactivity or on timer event. I will check those events out.

Thank you! I'll try it out.

PVLabel
Newcomer
Posts: 4
Joined: Fri Oct 11, 2019 4:48 pm

Re: Refreshing Variable for a timed event

Post by PVLabel » Tue Nov 26, 2019 10:26 pm

The Form Inactivity event works out rather well. I was able to attach a message every time there is a 1 minute of inactivity,.

However, would still trying to figure out a way to put a timer on a specific button so when 1 minute pass since pressing the print button and when the user press the button then the message window will pop up with the warning. The main purpose is to draw the user attention before they are able to print out the label. I will test it with the string manipulation to see if I could get it working with those.

Post Reply