|
Zafrusteria Wanderer
Joined: 11 Oct 2000 Posts: 94 Location: United Kingdom
|
Posted: Sun Jul 27, 2003 12:14 pm
testing strings |
How can you check it two strings do NOT match as the following always goes through the true path.
Set the value in a variable lookfor to "The Sands of Sorrow" on the command line.
Then create an alias test1 as below and call it with
test1 "Strange Glowing Sand"
#IF (@lookfor =~ "%2") {#SHOW TRUE} {#SHOW FALSE}
This is also always true
#IF (@lookfor = "%2") {#SHOW TRUE} {#SHOW FALSE}
I'm confused by this anyone got an answer to how I can check two strings? |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Jul 27, 2003 5:23 pm |
The problem is the double quotes. When you call the alias and enclose Strange Glowing Sand in double quotes, the alias treats the three words as the first parameter, so the all end up on %1.
|
|
|
|
Zafrusteria Wanderer
Joined: 11 Oct 2000 Posts: 94 Location: United Kingdom
|
Posted: Mon Jul 28, 2003 5:58 pm |
Sorry that was a typo on my part there it should all be in %1
after expansion in the alias it should be testing
"The Sands of Sorrow" = "Strange Glowing Sand"
or
"The Sands of Sorrow" =~ "Strange Glowing Sand"
Which coms out as TRUE *boggle* |
|
|
|
|
|