IF statement which test a variable text string?
IF statement which test a variable text string?
(OP)
I am having difficulty with the following IF scenario:
IF PTC_MATERIAL_NAME=(==?)STEEL (material steel & aluminum have been assigned in setup, as have the steel & alum spring rates as variable values)
SPRING_RATE=SPRING_RATE_STEEL
ELSE
SPRING_RATE=SPRING_RATE_ALUMINUM
ENDIF
I realized my syntax is bad with the initial IF statement, so what should it be if you don't mind responding? IF PTC_MATERIAL_NAME='STEEL' OR IF PTC_MATERIAL_NAME=="STEEL" or something similar.
Thanks....Mark
IF PTC_MATERIAL_NAME=(==?)STEEL (material steel & aluminum have been assigned in setup, as have the steel & alum spring rates as variable values)
SPRING_RATE=SPRING_RATE_STEEL
ELSE
SPRING_RATE=SPRING_RATE_ALUMINUM
ENDIF
I realized my syntax is bad with the initial IF statement, so what should it be if you don't mind responding? IF PTC_MATERIAL_NAME='STEEL' OR IF PTC_MATERIAL_NAME=="STEEL" or something similar.
Thanks....Mark





RE: IF statement which test a variable text string?
This should be the format for the initial iF.
"Wildfires are dangerous, hard to control, and economically catastrophic."
Ben Loosli
RE: IF statement which test a variable text string?
Mark
RE: IF statement which test a variable text string?
IF <parameter1> == "string1"
<parameter2> = "string2"
ELSE
<parameter2> = "string3"
ENDIF
string# could also be numeric values.
"Wildfires are dangerous, hard to control, and economically catastrophic."
Ben Loosli
RE: IF statement which test a variable text string?
Mark