View Full Version : What is the correct way to concatenate THIS_SCRIPT?
Simon Lloyd
03-31-2012, 09:44 PM
Hi all,
I've attempted to concatenate two THIS_SCRIPTs like this<if condition="THIS_SCRIPT != 'subscription' or THIS_SCRIPT != 'search'"> but it doesn't appear to work?
Is that the correct way?
--------------- Added 1333234232 at 1333234232 ---------------
For some strange reason i changed it to this<if condition="THIS_SCRIPT != 'subscription' AND THIS_SCRIPT != 'search'"> and it works!? wonder why it wouldn't work with OR?
If you think about it, since it can't be both 'subscription' and 'search' at the same time it's always going to be != to one of them, so in your first example the condition will always be true.
Simon Lloyd
04-01-2012, 07:08 AM
Doh!, it was approaching midnight here when i was attempting it, thanks for the explanation.
Pandemikk
04-01-2012, 07:13 AM
I'm also going to add this has nothing to do with string concatenation- or any form of concatenating.
What you're doing is simple expression evaluating with comparison operators.
And lastly, what exactly are you trying to do? :D
Simon Lloyd
04-01-2012, 08:02 AM
Well, that depends how you read it, to concatenate means to link or join together, so yes it is concatenating as i wanted to "join" two THIS_SCRIPTs.
As for what i'm trying to acheive, i wanted to only show a variable for all pages except "subscription" and "search :)
The second part of my message shows that i've done that, it was really late when i first posted, i then thought i'll just try the AND operator and it worked, i wasn't thinking too clearly at the time, KH99 pointed out why, i should have seen it really.
Pandemikk
04-01-2012, 08:16 AM
Okay. Glad you got it worked out. But that's still not concatenation. ;)
Boofo
04-01-2012, 08:29 AM
Okay. Glad you got it worked out. But that's still not concatenation. ;)
Exactly. Not in the true sense, anyway.
Well, that depends how you read it, to concatenate means to link or join together, so yes it is concatenating as i wanted to "join" two THIS_SCRIPTs.
I agree with that. What Pandemikk is talking about is string concatenation (which *is* what is normally meant by concatenation when you're talking programming) but that doesn't mean you couldn't use that word for what you're doing. I knew what you meant.
Doh!, it was approaching midnight here when i was attempting it, thanks for the explanation.
...and I didn't mean to imply that you hadn't thought about it, I guess what I meant to say was "If you think about it like this...".
Simon Lloyd
04-01-2012, 11:34 AM
...and I didn't mean to imply that you hadn't thought about it, I guess what I meant to say was "If you think about it like this...".Lol, i know, and no i didn't think of it that way last night :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.