the obvious and elusive '@'

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

Have you read the readme.chm all the way through?

Poll ended at Thu Jun 24, 2004 6:36 pm

More than once
7
32%
Yes. All the way through.
2
9%
I skimmed it because I already know most everything.
3
14%
I only use it when I need to.
9
41%
What readme.chm????
1
5%
Shut Up, NEWB! What a STUPID POLL!
0
No votes
 
Total votes: 22

JWWQ
a lesser mummy
a lesser mummy
Posts: 30
Joined: Sat Jun 19, 2004 4:58 pm

the obvious and elusive '@'

Post by JWWQ » Mon Jun 21, 2004 6:36 pm

Perhaps it's because the answer is so painfully obvious.
Perhaps it's because all programmers already know how to use it.
Perhaps it's because I am a moronic newb - Easy, tiger.


I see the @ sign in alot of macros in the boards and I am having trouble following its use, necessity, and attributes.

I poured over Wassup's EXCELLENT help file 'readme.chm' but it is not to be found there either(yet).

Could someone give me an easy explanation and perhaps an example?

heh--try searching for '@' in the search here.

Where can I find out stuff like this?

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Post by Drumstix42 » Mon Jun 21, 2004 7:34 pm

I did find this out of one of Lax's posts in the Announcment section:
MQ2Data was designed so that variables could also very easily use the same system. The way
MQ2DataVars works overall is to use variables as MQ2Data Top-Level Objects. Instead of
@Param1, you would use ${Param1} to access the variable. Each variable has a type, and in
this case Param1 is a string so you could use any member of the 'string' type directly from
the variable. So instead of ${String[@Param1].Length} to determine the length of the
parameter, you simply ${Param1.Length}.

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

Post by loadingpleasewait » Tue Jun 22, 2004 1:25 am

@ used to be how MQ would recognize custom variables.

example: @myvar1

However since the inclusion of MQ2DataVars, @ is now obsolete and replaced with ${}

example: ${myvar1}

If you find a macro that still has @ variables in it, it needs to be updated in order to work. Hope this helps. :)
LOADING PLEASE WAIT...

JWWQ
a lesser mummy
a lesser mummy
Posts: 30
Joined: Sat Jun 19, 2004 4:58 pm

thanks!

Post by JWWQ » Tue Jun 22, 2004 10:23 am

*note to self* Read all announcement boards before making an ass of myself.

You will be happy to know, though, that with your simple answer, I have converted and enhanced DriftSupra's Dumpster diver!


Thanks a Mil!

Remember that feeling when you were a young programming newb just starting to show first buds!

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Post by Drumstix42 » Tue Jun 22, 2004 3:51 pm

At least you approched the issue correctly.