script question

Open Source software contributions and discussions that supplement or extend the Palette / Light Palette software
Post Reply
User avatar
TaineGilliam
Posts: 1183
Joined: Tue Oct 23, 2007 5:15 pm
Location: Cleveland, OH
Contact:

script question

Post by TaineGilliam » Mon Oct 27, 2008 7:42 pm

I'm having a bit of a problem with the code below. The idea is to load the Lua variable with a Cue number and its Label given a Palette variable with the cue number.

The output to the history/status window makes me believe my loop is working except the test cnumber==Cue is failing. The test for empty string at least succeeds and at least prevents the never ending loop. I suspect some form of type mismatch but I'm not really sure.

Code: Select all

Cue = HC.VariableGet('MainV', 'Next_show');

if (Cue == 0) then
  tshow = "None"
else
  cindex = -1
  repeat
    cindex = cindex + 1
    cnumber = HC.GetProperty('cue', 'Main', cindex, 'number')
    HC.Status(":" .. cnumber .. ":" .. Cue .. ":")
  until ((cnumber=='') or (cnumber==Cue))

  tshow =  Cue .. " - " .. HC.GetProperty('cue', 'Main', cindex, 'name')
end
Taine

User avatar
BrianEvans
Posts: 700
Joined: Fri Oct 12, 2007 1:11 pm
Location: Orlando, Florida

Re: script question

Post by BrianEvans » Tue Oct 28, 2008 1:17 pm

Hello Taine,

We'll need a showfile to put this into context.
Brian Evans - System Specialist - Horizon Control Inc.

User avatar
TaineGilliam
Posts: 1183
Joined: Tue Oct 23, 2007 5:15 pm
Location: Cleveland, OH
Contact:

Re: script question

Post by TaineGilliam » Thu Nov 20, 2008 6:34 pm

I'm trying to extract the label for a cue based on the cue number (not index). I'm sure there is a better way, please point the way.

In my example script, the variable "Next_Show" contains a cue number. For example 23. I'm hoping to have the variable "tshow" end up with something like "23 - The start of the end".

In this application there is no predictable relationship between the cue number in "Next_Show" and the cue currently active on stage.

Thanks,
Taine

User avatar
BrianEvans
Posts: 700
Joined: Fri Oct 12, 2007 1:11 pm
Location: Orlando, Florida

Re: script question

Post by BrianEvans » Fri Nov 21, 2008 4:42 pm

I have no problem getting tshow to come up with the name of the cue specified by Next_Show.
Brian Evans - System Specialist - Horizon Control Inc.

Post Reply