Using variables (in on-screen displays)

Help each other out

Using variables (in on-screen displays)

Postby rbziggy on Sun May 29, 2005 11:55 pm

I'm running a set up (having just got it all working) with a couple of PPC Clients and a Server. One of the things I've done is to configure an alarm function using XEvent. This all works really well but there is a small feature that I cannot figure out that relates to using a variable to store and then display the alarm time. Here's what's happening...

I have a database setup with alarmtimes (which is unimaginatively called 'alarmtimes') setup at 10 minute intervals and then use a category field to display these on the screen.

I then have a button on the screen that has the button text of 'Set @ %alarmtimes>display% ?' (which will show, for example, 'Set @ 07:00 ?' when 07:00 is selected).

Pressing this button does some stuff of deleting old alarms in XEvent, writing to a variable (which I'll cover below) and then using the variable value to write a new event time using XEvent. All this works well.

Now the 'save to variable' command I use in the above takes the arguments of '%alarmtimes>display%' and 'atime' in the 'Information' and 'Variable' fields.

I then use this 'atime' variable in a couple of places. First, on the alarm setting screen as a banner text at the top of the screen which gives 'Wake-up: 07:00' from text coded as 'Wake-up: %variable>atime%'. Second, the same text is used on a button on the main ppcmenu which is the navigation button to the said alarm setting screen.

Well, this all looks fine and works well (and very reliably so far) at least in terms of setting up the event times.

But... It ONLY works fully on the device that you do the setting on. The other PPC and the server do not pick up the 'atime' values on their displays (even when the screen is refreshed / renavigated to). The other devices just show a blank for 'atime' (e.g just 'Wake-up:'). If you then use another ppc or the server to reset the alarm, that device will properly set the alarm event up and display the new time (say 07:30) but the original device happily continues to display the old (07:00) time and the final other device still shows blank.

I'm a bit confused about this as I'd assumed that a variable set in the server from an event command would be available to all devices with the same value and the other devices would thus show the same alarm time - a bit like what happens with the weather plugin which refreshes the display variables on all devices wherever the 'refresh' command is issued from.

From this behaviour it looks like each device has its own 'atime' variable rather than there being just one global variable of this name.

Is this what others have seen? Is it 'right', or a feature that others are aware of and use (for some purpose)? Or have I (I hope) missed a feature/command to synchronise these different local variables so they all collect the same value? (And, if so, how do I do this please?)

Confused I am... :?
rbziggy
 
Posts: 124
Joined: Mon Mar 21, 2005 11:49 pm
Location: UK

What is the scope of Variables (Local / Global)

Postby rbziggy on Wed Sep 21, 2005 10:11 pm

Posted the rather complex request a while back. It was a bit long so perhaps a simpler question...

What is the scope of a variable in XL?

To explain:
- I have XL running in server mode on a regular PC and two PPC clients.
- I use a variable to take a field from a database and display this on the screen. (e.g. in the text field I have %variable>fred%)
- The contents of 'fred' show up on the screen of the device that was being used at the time (i.e one of the ppcs or the pc screen for the server). For that device, 'fred' will still be seen whenever the screen is navigated to (i.e you can goto another screen, come back and still see the contents of 'fred').
- But when the same screen is subsequently pulled up on another device, the contents of 'fred' are not displayed.

From this, it seems that the variable is somehow 'local' to the device and is not global to any client device (or indeed the server display itself). This seems strange to me as I had envisaged a variable defined on the server would be global (shared with) to any client using that server. This is certainly the case with other regular items (e.g. something like the nowplaying variables).

Any explanation gratefully received or is this a bug?

Thanks
rbziggy
 
Posts: 124
Joined: Mon Mar 21, 2005 11:49 pm
Location: UK

Postby scalt on Thu Jan 19, 2006 6:44 am

Any updates on this? Because I too would like to use the "variable set" command and I though I would be able to use that variable accross many screen...which it would seem I won't be able to if this hasn't changed!
scalt
 
Posts: 75
Joined: Tue Dec 06, 2005 10:53 pm

Postby rbziggy on Thu Jan 19, 2006 5:45 pm

Me too!

Steve, if you could look at / comment on it would be really helpful.

Thanks
rbziggy
 
Posts: 124
Joined: Mon Mar 21, 2005 11:49 pm
Location: UK