Page 1 of 1 1
Topic Options
#146749 - 2005-08-28 04:14 PM short circuit logic OR comparisons
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
If I were to perform a logical "OR" comparison of two items, KiXtart seem to evaluation both sides of the "OR" before making the comparision.

If either the current "OR" could be altered or a new "shotcut OR" could be introduced we could


use the OR for flow control.

Code:

function A($)
Do something...
$A=@error
Exit @error
Endfunction


A(2)=0 or RaiseError("A(2) Failed: " + @serror)

_________________________
Home page: http://www.kixhelp.com/hb/

Top
#146750 - 2005-08-31 09:44 AM Re: short circuit logic OR comparisons
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
We already have this functionality:
Code:
If Not (A(2)=0) RaiseError("A(2) Failed: " + @serror) EndIf



Is there a reason that this is not sufficient? Other than improving your golf score of course

Top
#146751 - 2005-08-31 02:58 PM Re: short circuit logic OR comparisons
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I was looking for less strokes...
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#146752 - 2005-09-28 01:29 AM Re: short circuit logic OR comparisons
iffy Offline
Starting to like KiXtart

Registered: 2005-05-29
Posts: 149
Loc: The Netherlands
Changing the current behaviour is not done because of the potential impact on existing scripts. Instead add a few lines to the documentation about this "feature".
Top
Page 1 of 1 1


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

Who's Online
0 registered and 414 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.051 seconds in which 0.022 seconds were spent on a total of 12 queries. Zlib compression enabled.

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