#75930 - 2003-07-17 09:05 PM
Apparently I'm brain dead... Can't get execute to execute
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I would like to convert: code:
select case $check = 2 $item.subitems(1).text = iif($CheckBox2.Checked="false",'','¤') case $check = 3 $item.subitems(1).text = iif($CheckBox3.Checked="false",'','¤') case $check = 4 $item.subitems(1).text = iif($CheckBox4.Checked="false",'','¤') endselect
to an execute statement, like:
code:
$=execute("$$$item.subitems(1).text = iif($$$CheckBox$check.Checked="false",'','¤')")
but, I can't make it work...
|
|
Top
|
|
|
|
#75931 - 2003-07-17 09:15 PM
Re: Apparently I'm brain dead... Can't get execute to execute
|
Sealeopard
KiX Master
   
Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
|
Do yourself (actually, your brain) a favor and use SETOPTION('NoVarsInStrings','on'). This will eliminate th needs to use all those doubled and tripled up '$' signs.
Also, the IIF conmstruct should becode:
iif(not $CheckBox2.Checked,'','¤') ; or iif($CheckBox2.Checked,'¤','')
as .checked does not return "false" or "true" but -1/0.
_________________________
There are two types of vessels, submarines and targets.
|
|
Top
|
|
|
|
#75932 - 2003-07-17 09:18 PM
Re: Apparently I'm brain dead... Can't get execute to execute
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
code:
$iRC=SETOPTION('NoVarsInStrings','on') $=execute('$$item.subitems(1).text = iif($$CheckBox' + $check + '.Checked,"","¤")' )
i think... ![[Confused]](images/icons/confused.gif) [ 17. July 2003, 21:19: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#75934 - 2003-07-17 09:23 PM
Re: Apparently I'm brain dead... Can't get execute to execute
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
I seem to remember doing this in the Moan KixGolf and having to use "$$" for some reason. I have been looking for the test code but can't seem to find it.
I trust you Jens.
|
|
Top
|
|
|
|
#75935 - 2003-07-17 09:24 PM
Re: Apparently I'm brain dead... Can't get execute to execute
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
this did it
$=execute("$$item.subitems(1).text = iif($$CheckBox$check.Checked,'¤','')")
I have way too much code to go through to deal with novarsinstrings
freeform...
Thanks Guys
|
|
Top
|
|
|
|
#75936 - 2003-07-17 09:26 PM
Re: Apparently I'm brain dead... Can't get execute to execute
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
You can always set it on and turn it off at will if you code can benefit from it.
In fact I have been thinking about rewriting all my UDFs to use $iRC=SETOPTION('NoVarsInStrings','on') to insure it set to "ON" and then setting the original state when leaving the the UDF.
|
|
Top
|
|
|
|
#75937 - 2003-07-17 09:41 PM
Re: Apparently I'm brain dead... Can't get execute to execute
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Jens, you are again 100% correct.
I had to add an extra "$" to make an evaluted variable back into a variable.
code:
$x="a","b","c" $="" for each $y in $x if len($c)<3 and $y="c" $c=$mask[0+$c] else $z=execute('for each $z in split($'+$y+',".") $=$+$nums[0+$z] next $'+$y+'=$ $=""') endif next
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1386 anonymous users online.
|
|
|