PDA

View Full Version : Macros: concatenating strings?


Konoko
03-31-2002, 06:58 PM
Is it possible to concatenate 2 strings with "set"?
Something like
set msg_string string_a + string_b
where string_a and string_b are both string variables?

Or even
set msg_string string_a + "hello there" + string_b

I'm having problems. The out-dated macro manual says you can concatenate strings with the "+"

Doing something like the following works
message string_a string_b

but I'm trying to do something like
set msg_string "blah blah" + string_a + "hello there"

Any ideas, tips?
Is there a better place to look? Like an updated manual?

Thanks!

Konoko

Althus
03-31-2002, 07:10 PM
set blah string_a
set blah + string_b

Konoko
03-31-2002, 07:52 PM
Ahh!
Thanks Althus - I'll give it a shot.

Konoko
03-31-2002, 08:05 PM
ok, here's another one for the macro masters out there:

is it possible to have an || (OR) or a && (AND) in an if statement?
Like
if n == 1 || n == 2
blah blah
end if

I didn't see any indication that this should work in the manual.
What I'm doing is just setting a flag if n == 1. And then in a separate if statement i'm setting the same flag if n == 2. This works but it's not exactly the best way... :)

Thanks!

Konoko

Althus
03-31-2002, 08:08 PM
Sorry, no AND/OR functionality. I requested it WAY BACK a long time ago, but I was shot down by HGM, who said it wasn't really necessary.

You'll have to keep at it your current way :(