Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expressions with double "==" call out or Double "||". Whats the meaning?

Status
Not open for further replies.

3dr

Automotive
Jul 10, 2004
451
Example "==":
if(DIR==L_R)(9*PITCH_ALL)else if(STATION==6)(PITCH_ALL)else((STATION-4)*PITCH_ALL)

Example "||": (OR)
if(SLUG_TYPE==FILLET||SLUG_TYPE==RECTANGLE||SLUG_TYPE==MICKEY)(1)else(0)

I thought I'd seen it all when it comes to these symbols.
I'm in some wizard files and seeing this. Not sure these would be formatted like this.




Dave
Automotive Tooling / Aircraft Tooling / Ground Support Structures

NX11, Win 10 Pro
 
Replies continue below

Recommended for you

junk1_i9tr7w.png


Jerry J.
UGV5-NX11
 
I am still not sure why the documentation states
"| or ||" means Logical OR.

I have used both variants and both seem to do the same job.
But, is there a difference between "=" and "==" ?
My tests say they do the same or are "==" MUST be equal and "=" SHOULD be equal ? ;-)

Regards,
Tomas



 
Toost said:
But, is there a difference between "=" and "==" ?

I Think the developer had in mind the possibility to use != (Not Equal) Keep it two characters for the condition... :)

Ronald van den Broek
Senior Application Engineer
Winterthur Gas & Diesel Ltd
NX9 / TC10.1.2

Building new PLM environment from Scratch using NX12 / TC11
 
NX treats a single or double the same way.
A quick google shows that Java uses "==" & "||"

Could be that they guys making these seed files are just writing in the format they're more familiar with.
Just doesn't matter.




Dave
Automotive Tooling / Aircraft Tooling / Ground Support Structures

NX11, Win 10 Pro
 
Normally a double equal (==) is used for a comparison check as stated above. If a == b then …
A single equal (=) is used to set a variable to a value. C = 4.5.
Combined, you can write: If A == B then C = 4.5


"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
Earlier version of NX required "==" and "||" ... newer versions allow "=" and "|"

NX 12.0.2.9
Windows 10
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor