Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating a Variable
I loaded the CQCVariable Driver and want to create a variable. The docs show an interface, but I can't figure out how to get to that interface. What I would like to accomplish is to create a var called VarScopes, this would hold a string depicting the users selection of which horoscope sign they are. I then want to load a single interface template showing yesterday, today and tomorrow horoscopes from the horoscope driver and have all the applicable data reflect the current user selection. Just don't want the overhead of 12 different templates if it can be avoided.
Figured out that I needed to load the driver in the client side. Now to just figure out the rest of what I want to do with the horoscopes.
I'm not sure you want to use the variables driver for that. That's global and will affect every client. So you could only have one user viewing horoscopes at once.

What you really want to do is to use a global variable within your action. You create a button for each sign. Have each button set a global variable to the sign then load the horoscope template into the overlay. The template will have an OnLoad command that will use that variable to set up the horoscope widgets to look at the right driver/field.

If you do it this way, each client is separate. The hierrachy is:

1. Local variable. Lives for the life of the action and only visible within that action.
2. Global variable. Lives for the life of the interface window (for the IV, that means as long as the IV is up) and visible to other templates loaded into that window.
3. Variables driver. System wide, lives for the life of the variables driver being up and everyone shares it.
Dean Roddey
Explorans limites defectum
Created the variable VarScopes in CQCVariable Driver.

here is what I want to do:
1. using a command btn: Populate the VarScopes variable with 1 of 12 horoscope signs.

2. Load a single interface,which has 4 dynamic text fields.

3. Populate those 4 dynamic text fields with the appropriate information from the horoscope driver using the sign (Virgo, Pisces etc.) contained in the VarScopes variable.
You want to do what I indicated above. Don't use the variables driver. That's a system global resource and each client will be fighting each other over what's stored in it.

You would do the following:

1. Create the dynamic text fields and given them names
2. Have the buttons in the parent template set the variable to the name of the sign then load the template into the overlay
3. Use the Xlat tab of the loaded template to translate the fields that the dynamic text widgets are associated with to the apprpriate field for the selected sign (probably will just build it up using the literal sign name in the variable)
Dean Roddey
Explorans limites defectum
I do that in my horoscope template.

What you want to do is for each of your dynamic text widgets, go to the Basic tab and give them each a widget name. Under the field tab, assign them anything as you will change them on load anyway.

On the overlay itself with these widgets, right click and bring up attributes. Under the XLAT tab, you will see a list of all your widgets. Click on each one and change it to DriverName.%(IntVar:VarScopes)_Today, where

DriverName is the name of your horoscope driver,
VarScopes is your drivervariable that should have the value of the sign from your command button (IE, cancer, aries, sure the value you assign is all lowercase).
The _Today indicates the today field. For tomorrow, couples love, etc. change it to the suffix of the horoscopes driver field appropriately.

On your command button that launches the above overlay, you want to assign the VarScopes variable and then launch the overlay. So, edit the button for cancer, assign a value of cancer to VarScopes field, then launch the overlay.

EDIT: Dean is quick today. Same thing I said, other than Dean is recommending that you use a global variable instead. What I did above with the driver variable was for 1.6 which did not have global variables. However, the steps are the same.
So in 2.0, it would be something like:


where GVar:VarScope is the global variable you assigned in the invoking button.
Dean Roddey
Explorans limites defectum
Thanks everyone. I will remove the variable from the driver and use give it a shot with a non-Global var.
Actually it's a global variable. There are local and global variables. The variables driver isn't really related. It's just a device driver that allows you to create your own fields, and which is often used to create system wide variable type storage.
Dean Roddey
Explorans limites defectum
Ok Got it. Thanks again

Possibly Related Threads…
Thread Author Replies Views Last Post
  Dynamically Build Call to Variable? gReatAutomation 8 1,223 05-08-2020, 01:22 PM
Last Post: gReatAutomation
  Action wait and exit if variable changes simplextech 8 1,822 02-01-2020, 12:35 PM
Last Post: simplextech
  Time formatting RunTime Time Variable? gReatAutomation 5 1,388 08-14-2019, 05:23 AM
Last Post: gReatAutomation
  GVar... Variable GVar... Already Exists gReatAutomation 3 898 08-13-2019, 01:15 PM
Last Post: Dean Roddey
  Variable Error in Scheduled Task znelbok 3 1,392 03-22-2019, 09:30 AM
Last Post: Dean Roddey
  Question on Formatting of Variable Text kblagron 2 2,208 09-07-2018, 08:52 PM
Last Post: kblagron
  How would I manually collect digits to enter into a variable ghurty 1 1,244 05-24-2018, 08:51 PM
Last Post: Dean Roddey
  Embedded Variable in Text zra 2 1,915 05-07-2018, 09:59 AM
Last Post: zra
  Variable Limits Syntax Shaky 6 2,700 03-03-2018, 09:47 PM
Last Post: Dean Roddey
  Passing device name as variable jokermac 12 5,578 11-18-2017, 12:38 PM
Last Post: jokermac

Forum Jump:

Users browsing this thread: 1 Guest(s)