Page 1 of 1 1
Topic Options
#192628 - 2009-02-27 06:34 AM Setoption values
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4572
Loc: USA
I was just working on a script and was thinking... why is it that you have to do two lines of code just to query the value of a setting in SetOptions.

From the manual:
 Code:
$previousstate = SetOption("NoMacrosinStrings", "ON" )
$rc=SetOption("NoMacrosinStrings", $previousstate )


Just as I was about to ask if anyone knew of a shortcut, I tried...
 Code:
if Setoption("NoMacrosinStrings")="off"
  ...
endif

...and was surprised to find it worked exactly as I hoped.

Seems like the manual should be updated to include an example like this one, and to specify that the "Value" is optional. Who updates that thing?
_________________________
(... better days ahead)

Top
#192630 - 2009-02-27 07:28 AM Re: Setoption values [Re: Allen]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
woot.

I think this is one of the suprises ruud hid from us and left for us to find.
_________________________
!

download KiXnet

Top
#192633 - 2009-02-27 09:40 AM Re: Setoption values [Re: Lonkero]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Cool! An early Easter Egg \:\)
Top
#192642 - 2009-02-27 02:05 PM Re: Setoption values [Re: Richard H.]
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
That is very cool Allen.
Top
#192652 - 2009-02-28 04:51 AM Re: Setoption values [Re: Shawn]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Never thought about having a SETOPTION being part of a KiXgolf \:\/
_________________________
There are two types of vessels, submarines and targets.

Top
#192655 - 2009-02-28 05:39 AM Re: Setoption values [Re: Sealeopard]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4572
Loc: USA
Sooo... who updates the manual. Is that Ruud too?
_________________________
(... better days ahead)

Top
#192656 - 2009-02-28 10:29 AM Re: Setoption values [Re: Allen]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Yes - Ruud is the one who writes the Official Manual
Top
#192657 - 2009-02-28 04:02 PM Re: Setoption values [Re: Sealeopard]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
jens, maybe you didn't...
anyhow, to be tightass, it can't really be used as the rules say what setoptions need to stay on...
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (mole) and 1300 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.056 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org