Create Boolean parameters? - Script Writing - CHDK Forum

Create Boolean parameters?

  • 3 Replies
  • 2923 Views
Create Boolean parameters?
« on: 04 / June / 2012, 20:11:01 »
Advertisements
I know that any parameter we put in a script can be used as a Boolean value: 0 = false, and any other value = true.  But if someone is experimenting with a script they copied & don't quite understand, they might increment what is supposed to be a Boolean value up to the thousands.  It can be counted back down to zero, once they discover their mistake, but it would be so much more obvious how to use the parameter if it showed in the parameters list as a checkbox, or at least a number value that only toggles between 0 and 1.

Is there a way to implement Boolean parameters in uBASIC, so that they only accept true/false or 1/0 values? 
S3 IS with LensMate filter/hood adapter

*

Offline reyalp

  • ******
  • 14114
Re: Create Boolean parameters?
« Reply #1 on: 05 / June / 2012, 00:16:40 »
There is not currently any to enforce this in the script UI. There is currently some discussion going on in this thread http://chdk.setepontos.com/index.php?topic=8151.0 about how to improve the UI, including the script UI.
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3450
    • Photos
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Create Boolean parameters?
« Reply #3 on: 06 / June / 2012, 17:56:35 »
Holey smokes!  That's perfect, thanks!

Eric
S3 IS with LensMate filter/hood adapter


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal