×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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

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

Jerry J.
UGV5-NX11

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

The double equal sign, "==", is a test for equality (if a == b then...). The double pipe, "||", is the logical OR operator. The full list can be found in the docs; search for "expression syntax operators" or have a look here:
https://docs.plm.automation.siemens.com/tdoc/nx/11...

www.nxjournaling.com

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

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 ? winky smile

Regards,
Tomas

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

Quote (Toost)

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

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

(OP)
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

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

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

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

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

NX 12.0.2.9
Windows 10

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

White Paper – Choosing the Right Spring Loaded Connector
In today’s cost-sensitive world, designers are often driven to specify the lowest cost solution for every aspect of their designs to ensure that their solution is competitively priced and their company remains profitable. However, specifying a low-cost, low-quality connector solution can result in premature failure, considerable re-work costs and damage to reputations. Download Now
eBook – Own the Lifecycle: Sustainable Business Transformation
Increasingly, product and services companies are seeking more information and control in the operational lifecycle of their products, including service and use. Better information about the operational lifecycle, and the ability to use that information, requires more than just unstructured data flowing back from products in the field. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close