Comparision of string variables

I have written the below Opto Script for comparing two string variable but I am getting compile error. Why and how to solve.

if (sFileName <> sFileName_New) then

nRun=5;

endif

Compiling…
Error on line 33: Syntax error - cannot use “sFileName_New” with the “<>” operator.
1 error(s), 0 warning(s)

I’ve run into this in the past.

You need to setup as

if (sFileName == sFileName_New) then
///do nothing
else
nRun=5;

endif
1 Like

or

if (not sFileName == sFileName_New) then
  nRun=5;
endif
1 Like

Thank you all for your response and it helped me.

1 Like