Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable Limits Syntax
#1
Can anyone point me to a link in the documentation that shows the syntax to use for setting variable limits?  i.e. SafeCreatevariable(varname,type,limits,initval).

What are the options for limits and the syntax? I found the syntax the other day somehow on the forum or maybe the documents but now can't find it for the life of me.. I would expect it or a reference to it somewhere in here perhaps? http://www.charmedquark.com/Web2/CQCDocs/CQCDocs.html?topic=/Reference/Actions&page=/Variables

I need to create a Gvar with a limit of 1-10 is all and can't figure it out.

Thanks
Reply
#2
They are the same type of limits that fields use. I should put a link to that there. I'll add that to doc updates to make.

http://www.charmedquark.com/Web2/CQCDocs...ge=/Fields
Dean Roddey
Software Geek Extraordinaire
Reply
#3
Thanks Dean! That's exactly what I had found the other day, a link would be good.
Reply
#4
OK, I need another steer related to this or maybe it's more of a question about some limits of the slider widget enforced now.

I have some sliders I use for settings of 1-10 via an external command.  They are variable based sliders.  Somewhere along the upgrade path or maybe some tweaking I did they stopped working.  I get the error message:"The value written to variable assignment exceeds the set variable limits"  I've ignored this for over a year and am just getting around to fixing...

I think somewhere you simply started enforcing something around variable limits that wasn't there in past is my guess... but who knows.  Maybe I borked something myself.

To fix:

I now create a GVar with a specified limit of Range 0,10.  I figured that would fix this because in past the range wasn't set at all (blank).  

Here's the rub and where I have been stuck for a couple days... I just figured out that if I set a range of anything with an upper limit of less than 15 I get the error from the slider widget.  If I were to use 0,15 it all works (except that I don't have a case statement for the upper range... I set up for 0-10.) 

Is it simply that you can't have a range lower than 15 for a variable slider now?  If that's the case I think a lower limit of 10 would be better.... not just because I'm lazy and don't want to change my templates :-)   Thoughts/ explanation?  Am I right on this range limit now or could I be doing something else wrong? Maybe it never worked quite right as far as setting values, but I know the error was never there.
Reply
#5
It looks like it's 16. I think what happened was that I consolidated a number of ad hoc limits into one set that is applied to all so that they could be changed for everyone at once if needed, and presumably I missed that one of them was less than 16. That probably happened in the 5.x work. I could lower it to 10. I was just keeping it even binary values.

In the meantime set it to 20 and divide by 2 maybe?
Dean Roddey
Software Geek Extraordinaire
Reply
#6
(03-03-2018, 03:49 PM)Dean Roddey Wrote: It looks like it's 16. I think what happened was that I consolidated a number of ad hoc limits into one set that is applied to all so that they could be changed for everyone at once if needed, and presumably I missed that one of them was less than 16. That probably happened in the 5.x work. I could lower it to 10. I was just keeping it even binary values.

In the meantime set it to 20 and divide by 2 maybe?

OK, certainly not an emergency or anything.  Might be good to also add to the docs or will you change back in software at some point in a future drop?

Yeah good idea I can maybe do a div. by 2 or something although I've used this quite a lot so might be more pain than just waiting for a new drop whenever that may be.  I'll handle it one way or another, not a problem.  Thanks for the prompt response as usual!
Reply
#7
I'm lower it back down to 10. I already have actually. So whenever the next drop comes out, it will be there. The next drop though will be the first real beta, not just another 5.2.x followup.
Dean Roddey
Software Geek Extraordinaire
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  How would I manually collect digits to enter into a variable ghurty 1 62 05-24-2018, 08:51 PM
Last Post: Dean Roddey
  Embedded Variable in Text zra 2 143 05-07-2018, 09:59 AM
Last Post: zra
  Passing device name as variable jokermac 12 1,401 11-18-2017, 12:38 PM
Last Post: jokermac
  Variable Driver Trigger Error zra 4 1,482 07-06-2017, 01:00 PM
Last Post: zra
  Syntax checking Ron Haley 5 815 09-19-2016, 08:26 PM
Last Post: Dean Roddey
  Inserting global variable into command string MikeA 2 843 06-26-2016, 10:09 AM
Last Post: MikeA
  Set Variable field with Slider (Variables driver) pinballmark 2 948 08-28-2015, 01:55 PM
Last Post: pinballmark
  Variable Find action? dlmorgan999 3 967 05-21-2015, 05:00 PM
Last Post: dlmorgan999
  What command would I use to write a field value to a variable? ghurty 4 1,190 01-28-2015, 02:57 PM
Last Post: znelbok
  Time display in variable driver gone :( bbrendon 7 1,873 01-11-2015, 05:11 PM
Last Post: bbrendon

Forum Jump:


Users browsing this thread: 1 Guest(s)