 |
Zhiroc Adept
Joined: 04 Feb 2005 Posts: 246
|
Posted: Sat Aug 27, 2005 5:13 pm
inconsistent behavior in an #IF |
Using
Code: |
#TRIGGER {^test (%x)} {#SHOW |%pos( bc~), "%1")| |%pos( bc, "%1")| |%pos( bc~), %1)| |%pos( bc, %1)|;#IF (%pos( bc~), "%1")>0) {#SHOW true with paren with quote};#IF (%pos( bc, "%1")>0) {#SHOW true without paren with quote};#IF (%pos( bc~), %1)>0) {#SHOW true with paren without quote};#IF (%pos( bc, %1)>0) {#SHOW true without paren without quote}} |
and then saying "#SHOW test 1,(abc)", I get the output:
Code: |
test 1,(abc)
|5| |5| |0| |0|
true without paren with quote
true with paren without quote |
I would have expected both of the first two 'if's to be triggered but neither of the last two (but only because of the rather non-intuitive behavior of parsing for argument separators inside of replaced strings). |
|
|
 |
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: Sun Aug 28, 2005 12:03 pm |
Code: |
#SHOW %pos( "~)", "%1")
#IF (%pos( "~)", "%1")>0) {#SHOW true with paren with quote} {#SHOW false}
#SHOW %pos( bc, "%1")
#IF (%pos( bc, "%1")>0) {#SHOW true without paren with quote} {#SHOW false}
#SHOW %pos( "bc~)", %1)
#IF (%pos( "bc~)", %1)>0) {#SHOW true with paren without quote} {#SHOW false}
#SHOW %pos( "bc", %1)
#IF (%pos( "bc", %1)>0) {#SHOW true without paren without quote} {#SHOW false}
|
quotes make a difference. |
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|