Feed variable value into progress bar?

Dear all,

I have an issue with a progress bar I am trying to display in my panel while a loop is running.

The code for my ValDisplay in appearance of a bar is as follows:

ValDisplay valdispProgress,pos={11,448},size={856,12},frame=2,limits={0,100,0}, barmisc={0,0}, value=progress

The problem is, that I get an compile-failure because Igor does not like the value=progress statement.
The variable progress is modified by one of the loops started from the panel and I am not able to hand it's value to the progress bar...

I already tried accessing the Variable  progress by making it a global variable and declaring it directly in the panel:

NVAR progress=root:progress

But this gives me an error - probably because Variables cannot be declared in panels...

How can I acccess my Variable from the panel?

Thanks in advance,

The answer to your problem depends on how you update your value in your function. Is there any reason why you want to use a variable to hold your update value (e.g., you use it somewhere else, too)? For example, you can just use value=_NUM:your_latest_value_here all the time. Also I am not sure if it is a good idea to use this approach while a loop is running. Can you maybe use a background task to do your task?
So I could access the SetVar from within the loop and set the value this way?

Cool, will try that!
IF you want to use the global variable do this instead