From the Programming Guide, page 35:
@INSTR(x,y) Returns the position of the first occurrence of y in x.
X is where you are looking st to find Y
Y is what you are looking for inside X.
Mark's suggestion here was correct:
Quote:// Place all the numbers to check in a single variable (or hidden field in Q&A). Do this only once, if possible.
// Separate them with semicolons.
MyField = "3500;6472;3444;3481;3751;3915;2897;3939;4029;2318;3907;2075;2834;4883"
// Then, where ever the check has to occur (CheckField is the same as Infinity's field #4950)
cf = CheckField + ";"
if(@instr(MyField, cf) > 0) then
// Do Stuff
endif
Carl's suggestion to use leading and trailing semicolons is also correct.
So, you are looking in MyField to see if the value in Billling_Code is there.
So, X = MyField, and Y = Billing_Code surrounded with semicolons. =
";3500;6472;3444;3481;3751;3915;2897;3939;4029;2318;3907;2075;2834;4883;"
So the following code should Take Action if the Billing Code number is in the string MyField which was defined earlier, with leading and trailing semicolons, with semicolon separators, no spaces.
IF (@INSTR(MyField, ";" + Billing_Code + ";") > 0) THEN {
// Take Action
WriteLn("Take Action")
}
And what is the result?