Page 1 of 1

Compare strings!

Posted: Mon Mar 23, 2026 7:52 pm
by jgu1
Hi all!


Inside an If decision I can write: String_One = String_Two, it working.

In Built_in_funktion fs is the CompareS( ), how do I use this in an If funktion I have test with CompareS( String_One, String_Two ) and more attemp?

I have seach in Wiki but can´t find examble and what is best :)

Thank´s

Re: Compare strings!

Posted: Mon Mar 23, 2026 7:57 pm
by BenR
Hello,

The decision and the compare function both end up with similar c code.

To use the compare function you do this

Result = compare$(str1, str2, case)

Result is 0 if the strings match.

Case is 0 for case insensitive or 1 for case sensitive.

The new str1 = str2 in the decision allows for a shorthanded way of writing compare$(str1, str2, 1) == 0

Re: Compare strings!

Posted: Mon Mar 23, 2026 8:03 pm
by jgu1
Thank you Ben :lol: