a syntax question
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2005-08-15 04:33 AM
‎2005-08-15
04:33 AM
Where "lmtr" is an angle type parameter,
is the expression "if 0<lmtr<180 then ...do something"
a valid substitute for and has the same meaning as the expression
"if lmtr >0 AND lmtr<180 then...do something" ?
Thank you,
Peter Devlin
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2005-08-15 08:33 AM
‎2005-08-15
08:33 AM
I don't think so, because the operators =,<,> are boolean operators and are not a defining statement as RANGE in VALUES.
AC will first calculate 0<lmtr with the result 0 or 1 and then result<180.
0<lmtr<180 = ( (0<lmtr) <180)
lmtr=-10 -> (0<lmtr) =0 -> 0<180=1 -> result true
lmtr=45 -> (0<lmtr) =1 -> 1<180=1 -> result true
lmtr=210 -> (0<lmtr) =0 -> 0<180=1 -> result true
But (0<lmtr) * (lmtr<180) should work:
lmtr=-10 -> 0*1=0 -> result false
lmtr=45 -> 1*1=1 -> result true
lmtr=210 -> 1*0=0 -> result false
or ABS(lmtr-90)<90
But thats all not more readable than (0<lmtr) AND (lmtr<180)
AC will first calculate 0<lmtr with the result 0 or 1 and then result<180.
0<lmtr<180 = ( (0<lmtr) <180)
lmtr=-10 -> (0<lmtr) =0 -> 0<180=1 -> result true
lmtr=45 -> (0<lmtr) =1 -> 1<180=1 -> result true
lmtr=210 -> (0<lmtr) =0 -> 0<180=1 -> result true
But (0<lmtr) * (lmtr<180) should work:
lmtr=-10 -> 0*1=0 -> result false
lmtr=45 -> 1*1=1 -> result true
lmtr=210 -> 1*0=0 -> result false
or ABS(lmtr-90)<90
But thats all not more readable than (0<lmtr) AND (lmtr<180)
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2005-08-15 09:31 PM
‎2005-08-15
09:31 PM
Frank,
Thank you very much for your reply.
Very concisely put and answers my question.
Your final statement makes me curious about something.
You wrote: "But thats all not more readable than (0<lmtr) AND (lmtr<180)"
Why are the parentheses necessary ?
Thank you,
Peter Devlin
Thank you very much for your reply.
Very concisely put and answers my question.
Your final statement makes me curious about something.
You wrote: "But thats all not more readable than (0<lmtr) AND (lmtr<180)"
Why are the parentheses necessary ?
Thank you,
Peter Devlin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2005-08-16 12:29 AM
‎2005-08-16
12:29 AM
You wrote: "But thats all not more readable than (0<lmtr) AND (lmtr<180)"They aren', but I like to see the terms visual separated and sometimes I add some clearing parentheses. You are right, 0<lmtr AND lmtr<180 comes to same result. It seems the order is:
Why are the parentheses necessary ?
^
*/
+-
<>=
AND OR
NOT(), because it's a function, does not need to be set in this order.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2005-08-16 01:53 AM
‎2005-08-16
01:53 AM
Thanks for the explanation Frank.
Peter Devlin
Peter Devlin