Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Hello,
I have created a new paramter and set to to the 'note' type.
how can i use the alphanumeric values entered inthis note to drive relations.
for example, my note says SL125A
I would like an IF syntax that returns a numerical value when this is entered.
IE
IF PARAMETER_1 == SL125A
PARAMETER_2 = 15
ELSE
PARAMETER_2 = 1
Can anybody help?
I tried putting */ , ' , and " around the note value but none of these worked.
when using ' and " the error message read
error Left and right sides are incompatible
What does this mean?
The following works (given that there are no other relations in the code):
if parameter1=="SL125A"
parameter2=15
else
parameter2=1
endif
Parameter1 was predefined as a string and given a value prior to writing the above relation. You get the incompatible error when you assign a variable as a certain type (integer, string) but then try to use it as another type. And I believe you can define or use a string with either " or '
For example, if I define parameter1 earlier in the code as a real number:
parameter1=1.0
And then try to use it as a string:
if parameter1=="1" ......
I will get the incompatibility error. Just make sure your variable types are consistent throughout your relations. That being said, you can change the variable type by assigning it directly as something else as long as it isn't used as another variable type later on in your code:
parameter1==2.0 /*real number
parameter1=="blahblah" /*becomes a string