Variable text issue
huttencm
Posts: 23
My brain may have falling down and can?t get up and/or I am missing something.
Background: I have a AutoPatch 8Y with 128x128 (64x64 RGBHV, 32x32 Video, 32x32 Audio) I am using variable text buttons to display source on the destination buttons.
What I am trying to do is use a CHAR array for the text:
DEFINE_VARIABLE
Volatile Char Source[129][40] // setup array
DEFINE_START
Source [1] = '*Ldr|#19'
Source [2] = '*Ldr|#28'
Source [3] = '*Ldr|#29'
Source [4] = '*Ldr|#38'
Source [5] = '*Ldr|#1'
Source [6] = '*Ldr|#9'
Source [7] = '*Ldr|#18'
Source [8] = '*Fl Box|Left'
Source [9] = '*Fl Box|Right'
Source [10] = '*Unclass|#1'
.
.
.
Source [128] = '*Building|Audio'
The string I send to the TP:
SEND_COMMAND vdvTP,"'^TXT-2,&1',Source[AUTOINP]"
The two issues I have are:
As you can see above in the array it drops the first character when it displays. So I put in an asterisk as a throw away character. Why?
And second, in the state location of the send_command if I use a single digit it won?t display at all. Anything else and it displays to all states (see send_command above). I need to change text for a specific state not all states.
Thanks for taking the time to look at this and any help you can give me.
Michael
Background: I have a AutoPatch 8Y with 128x128 (64x64 RGBHV, 32x32 Video, 32x32 Audio) I am using variable text buttons to display source on the destination buttons.
What I am trying to do is use a CHAR array for the text:
DEFINE_VARIABLE
Volatile Char Source[129][40] // setup array
DEFINE_START
Source [1] = '*Ldr|#19'
Source [2] = '*Ldr|#28'
Source [3] = '*Ldr|#29'
Source [4] = '*Ldr|#38'
Source [5] = '*Ldr|#1'
Source [6] = '*Ldr|#9'
Source [7] = '*Ldr|#18'
Source [8] = '*Fl Box|Left'
Source [9] = '*Fl Box|Right'
Source [10] = '*Unclass|#1'
.
.
.
Source [128] = '*Building|Audio'
The string I send to the TP:
SEND_COMMAND vdvTP,"'^TXT-2,&1',Source[AUTOINP]"
The two issues I have are:
As you can see above in the array it drops the first character when it displays. So I put in an asterisk as a throw away character. Why?
And second, in the state location of the send_command if I use a single digit it won?t display at all. Anything else and it displays to all states (see send_command above). I need to change text for a specific state not all states.
Thanks for taking the time to look at this and any help you can give me.
Michael
0
Comments
From a Modero manual:
---
SEND_COMMAND Panel,"'^TXT-500.504&510.515,1&2,Test Only'"
Sets the On and Off state text for buttons with the variable text ranges of 500-504 & 510-515.
---
The comma behind the states is also part of the command, and it is missed in your codeline.
Let's use Source[10]. With your command line it will result in a
SEND_COMMAND vdvTP,"'^TXT-2,&1*Unclass|#1'"
This may be the cause why the 1st character is always missed...
If you want to set the text only for state 1, the command should be
SEND_COMMAND vdvTP,"'^TXT-2,1,',Source[AUTOINP]"
Or from the panel's view:
SEND_COMMAND vdvTP,"'^TXT-2,1,*Unclass|#1'"
For setting the text to state 1 and 2:
SEND_COMMAND vdvTP,"'^TXT-2,1&2,',Source[AUTOINP]"
Kind regards,
SEND_COMMAND Panel,"'^TXT-500.504&510.515,0,Test Only'"
But you definitely need a comma in there as part of the command and '&1" by itself is not correct. Either make it '0' or make it '1', or make it '1&2', depending, of course, on what states it applies to.