Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Syntax for variable action
#1
I need some help establishing the correct syntax for this variable action. I want to evaluate whether or not any previously entered numbers are present in a variable field for my Dish Network keypad display. I have the following action started using the #1 key press as an example:

Devices::FieldWrite
P1=GlobalCache.Invoke
P2=VIP 722.1
P3=True
If Devices::FieldRead
P1=Variables.NumberDisplay
P2=GVar:NumberDisplay isnull
P3=True
GlobalVars::SetVariable
P1=GVar:NumberDisplay
P2=1
Devices::FieldWrite
P1=Variables.NumberDisplay
P2=%(GVar:NumberDisplay)
P3=True
Else
GlobalVars::Append
P1=GVar:NumberDisplay
P2=1
Devices::FieldWrite
P1=Variables.NumberDisplay
P2=%(GVar:NumberDisplay)
P3=True
End


I'm trying to append subsequent key presses to previously entered numbers (e.g. 3+0+0 = channel 300) in the "numberdisplay" variable and then display it a field text widget).
Reply
#2
Maybe I'm not really answering your question, but the general way to do this is to provide a display of the entered digits, then just get the final result out of the display text widget. Then you don't have to remember anything. The static text widget is designed to support this with append, backspace, and clear commands, which allow you to create a simple entry field.

If you look at the web site, under Learn->Videos, there's a how to video on creating such a keypad. Actually, I think that there's an auto-generation option in the designer to spit out such a keypad for you, then you just have to adjust the appearance and what to do on the button press.
Dean Roddey
Explorans limites defectum
Reply
#3
I see where the Displaytext widget works well to append, but I also want to store the last number entered in a variables.field and then clear the static text field (number display window) after XX time. How is that accomplished?
Reply
#4
khill Wrote:I see where the Displaytext widget works well to append, but I also want to store the last number entered in a variables.field and then clear the static text field (number display window) after XX time. How is that accomplished?

I'm not sure I understand completely what you are trying to do so I'm not sure exactly what answer to give you. Can you explain the scenario a bit more?
Dean Roddey
Explorans limites defectum
Reply
#5
Sure.

1. I want to enter up to 4 numbers from the keypad [I know to "SetMaxChars(4)" from the video]
2. Have the results display in the static text field above the keypad [I've done this with the static text widget "Displaytext"]
3. I would like to write the value displayed in the static text field to Variables.NumberDisplay [ ??? ]
3. I then want to start a CDtimer for 10 seconds after which the static text field is cleared. [I have the CDTimer setup and it launches upon button press and trigger is set on the field. I don't know how to clear the the Displaytext widget from the trigger action event]
4. I will then use Variables.NumberDisplay value to display the "Current Channel"
Reply
#6
khill Wrote:Sure.

1. I want to enter up to 4 numbers from the keypad [I know to "SetMaxChars(4)" from the video]
2. Have the results display in the static text field above the keypad [I've done this with the static text widget "Displaytext"]
3. I would like to write the value displayed in the static text field to Variables.NumberDisplay [ ??? ]
4. I then want to start a CDtimer for 10 seconds after which the static text field is cleared. [I have the CDTimer setup and it launches upon button press and trigger is set on the field. I don't know how to clear the the Displaytext widget from the trigger action event]
5. I will then use Variables.NumberDisplay value to display the "Current Channel"

Anyone have suggestions for #3 & #4?
Reply
#7
khill Wrote:Anyone have suggestions for #3 & #4?

For #3, just get the value out of the text widet into a local variable and write it to a field. Actually the text widget itself has a command to write its currently value to a field if you want to do it that way.

For #4, instead of using a timer driver and all that, use the OnTimeout event of the popup that the keypad is in. Set it to pop in ten seconds and in the OnTimeout just clear the text widget.
Dean Roddey
Explorans limites defectum
Reply
#8
So for #4 the keypad is a static piece of my DishNetwork template. The numbers display directly above the keypad and are what I want to clear after X seconds.

So I think I need a timed event to run an action to clear the static text widget of the previously entered numbers.

I'm not opposed to approaching this differently, I just didn't follow your thought.
Reply
#9
The OnTimeout is a timer basically within the template. You set the timer and after it runs out, you get the OnTimeout event at the template widget level. You can then either let it continue retriggering, or you can stop it from going again by just turning off the timer when you get the onTimeout event.
Dean Roddey
Explorans limites defectum
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Where's the Action Editor? Deane Johnson 4 1,839 07-30-2019, 02:50 PM
Last Post: Dean Roddey
  How to pass a variable into a field moniker EST 3 2,673 08-30-2016, 11:01 AM
Last Post: EST
  User Action on ZWave Keypad jkmonroe 18 8,342 04-04-2015, 05:46 AM
Last Post: jkmonroe
  How to put a pause in an Action list? Deane Johnson 10 5,006 11-30-2014, 11:22 AM
Last Post: Dean Roddey
  Action command help lleo 3 2,657 10-08-2014, 11:25 AM
Last Post: Dean Roddey
  Crimson Editor Syntax highlighting rhamer 7 5,287 07-31-2014, 12:28 PM
Last Post: bbrendon
  VRCOP User Action Configuration potts.mike 30 10,461 05-11-2014, 09:06 PM
Last Post: potts.mike
  Variable Times for Triggered Events TurboSam 9 5,520 11-19-2013, 10:00 PM
Last Post: Dean Roddey
  Include Variable in button text? rtarver 3 2,275 09-24-2012, 05:34 PM
Last Post: Dean Roddey
  UltraEdit CML and PDL Syntax files batwater 6 3,864 08-22-2012, 01:45 PM
Last Post: batwater

Forum Jump:


Users browsing this thread: 1 Guest(s)