Compairing Strings, part II

Need help running MacroQuest2? Ask your questions about how to get things to work on your computer.

Moderator: MacroQuest Developers

Micro
a lesser mummy
a lesser mummy
Posts: 40
Joined: Fri Mar 12, 2004 5:56 pm

Compairing Strings, part II

Post by Micro » Sat Apr 24, 2004 1:03 pm

The announcement lists "== != < > <= >= && ||" as compairison operators.

What is notably missing is Contains, the old ~~

if (${String["This long sentance"]} ~~ "long") /echo true

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Sat Apr 24, 2004 1:07 pm

Umm.. you missed the part that says those are not for string comparisions
Lax wrote: string
- Members:
...int Find[text]: Looks for the given text, gives position (currently NULL if not found)
...int Length: The length of the string
...string Upper: The string in all UPPER CASE
...string Lower: The string in all lower case
...string Left[length]: The left (length) of the string.. Left[2] of "Left" will be "Le"
...string Right[length]: The right (length) of the string.. Right[2] of "Left" will be "ft"
...string Mid[position,length]: The left (length) starting at (position).. Mid[2,2] of "Left" will be "ef"
...int Compare[text]: -1 if the string is alphabetically before text, 0 if equal, 1 if after. Case does not count.
...int CompareCS[text]: -1 if the string is alphabetically before text, 0 if equal, 1 if after. Case counts.
...bool Equal[text]: Strings equal? Case does not count...
...bool NotEqual[text]: Strings not equal? Case does not count...
...bool EqualCS[text]: Strings equal? Case counts!
...bool NotEqualCS[text]: Strings not equal? Case counts!
...string Arg[n,separator]: Gets nth argument using separator as the separator (single character). If separator is not given, defaults to space
- To String: ... this IS a string, assface

Micro
a lesser mummy
a lesser mummy
Posts: 40
Joined: Fri Mar 12, 2004 5:56 pm

Post by Micro » Sat Apr 24, 2004 1:11 pm

Gawd, no wonder i didnt find it, I mispelled Compare!

Micro
a lesser mummy
a lesser mummy
Posts: 40
Joined: Fri Mar 12, 2004 5:56 pm

Post by Micro » Sat Apr 24, 2004 1:17 pm

Add to that, its also Find[blah]

I only repeat this for my fellow scripters.

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Sat Apr 24, 2004 1:50 pm

Wow. If you saw that just image what would happen if everyone went to this fucking thread and actually read about TLO.

http://macroquest2.com/phpBB2/viewtopic.php?t=6022