Using a Variable to drive a color for a text label

Moderator: Moderator Group

Using a Variable to drive a color for a text label

Postby chrisr » Fri Jan 29, 2016 10:34 pm

Good afternoon all!
OK so here it is, I have entered a new variable we will call it VarColor1. I am placing this variable into this script
WDLabelTextColour,xx,VarColor1 I am not getting any response from this. So first question is CAN I do this. Second is I think maybe I am writing this into the Variable table wrong. I have tried different types of Vars such as string / Double / Integer etc. Also I have tried writing the RGB value with commas and without. Any Ideas? Thanks in Advance!

Cheers
Thank You

ChrisR
SurfacePro3 - 2GHz i5 - 4GB ram - Windows 10 Pro - WD Pro 4.7 Rev2500 and WD v6
Sager Laptop - Intel 2.4GHz i7 3630QM - 16GB ram - Windows 7 Pro Svc Pack1 - Offline Manager v6
chrisr
 
Posts: 143
Joined: Tue Jan 26, 2016 10:50 pm

Re: Using a Variable to drive a color for a text label

Postby chrisr » Fri Jan 29, 2016 11:00 pm

OK... So this is how I went about this. Not sure if this is the only / best way but I got it done.

I wrote three variables, one for each color. R_Var1 / G_Var1 / B_Var1. Totally works if I just place this in for each color value. If there is a better way to accomplish this Im all ears!

Best,
Thank You

ChrisR
SurfacePro3 - 2GHz i5 - 4GB ram - Windows 10 Pro - WD Pro 4.7 Rev2500 and WD v6
Sager Laptop - Intel 2.4GHz i7 3630QM - 16GB ram - Windows 7 Pro Svc Pack1 - Offline Manager v6
chrisr
 
Posts: 143
Joined: Tue Jan 26, 2016 10:50 pm

Re: Using a Variable to drive a color for a text label

Postby Thomas Mrozek » Mon Feb 01, 2016 4:23 pm

Hi Chris,
this is the way you'll have to do it. Only thing you can put in in an array, but you will end up nearly same:
WDLabelTextColour,xx,VarColor[1],VarColor[2],VarColor[3]

cheers
Thomas
Thomas Mrozek
Product Manager
User avatar
Thomas Mrozek
 
Posts: 138
Joined: Mon Apr 20, 2009 11:08 am

Re: Using a Variable to drive a color for a text label

Postby chrisr » Mon Feb 01, 2016 4:40 pm

Thomas,
Thanks! yes thats what I ended up doing. Works very well thanks. I was just curious if there was a way to do this and have only one variable not three.

Cheers!!

Chris
Thank You

ChrisR
SurfacePro3 - 2GHz i5 - 4GB ram - Windows 10 Pro - WD Pro 4.7 Rev2500 and WD v6
Sager Laptop - Intel 2.4GHz i7 3630QM - 16GB ram - Windows 7 Pro Svc Pack1 - Offline Manager v6
chrisr
 
Posts: 143
Joined: Tue Jan 26, 2016 10:50 pm


Return to Widget Designer V4.7

Who is online

Users browsing this forum: No registered users and 20 guests

cron