What is with the V numbers?

Need help running MacroQuest 1? Too bad! Use MQ2.

Moderator: MacroQuest Developers

skysurf
a lesser mummy
a lesser mummy
Posts: 52
Joined: Fri Aug 15, 2003 1:54 am

What is with the V numbers?

Post by skysurf » Tue Aug 26, 2003 12:16 pm

I have put in my time and read over 300 pages of programming books in the last 2 weeks. Im finally breaking down and just asking. What do the Vxx statements mean after # declarations?

I have a feeling I could find out from going through the source code /cringe, and I will if I have to, but I figured I would ask here first.


Sky

P.S. On a side note, I have ALWAYS wanted to learn to program but MQ is the very first thing to even remotely motivate me enough to learn, so when you answer my question make sure to send me in the right direction if you can, but dont give it all away hehe. Trying to learn this stuff is fun, but the Vxx's I just cant seem to figure out.

ThatOtherGuy
a lesser mummy
a lesser mummy
Posts: 41
Joined: Tue Aug 05, 2003 6:12 pm

Post by ThatOtherGuy » Tue Aug 26, 2003 12:27 pm

if you mean as in
#define RandomThingy v92
the v92 is teh variable you're assigning RandomThingy to
Kinda like
Dim RandomThingy String
in visual basic (censor: i'm an idiot; please ignore me)
-TOG

Doodman
a ghoul
a ghoul
Posts: 124
Joined: Thu Jan 02, 2003 12:07 pm

Post by Doodman » Tue Aug 26, 2003 2:14 pm

ThatOtherGuy wrote:if you mean as in
#define RandomThingy v92
the v92 is teh variable you're assigning RandomThingy to
Kinda like
Dim RandomThingy String
in visual basic (censor: i'm an idiot; please ignore me)
Well, not exactly.

A little background:
Variables in MQ are numbered. .$v0, $v1, $v2, etc..
#define a b Will replace where ever 'a' is found with 'b'.

So:

Code: Select all

#define RandomThingy v92
/varset RamdomThingy 2
/echo $RandmonThingy
Is the same as:

Code: Select all

/varset v92 2
/echo $v92
But just more human readable.

Doodman

Consilium
Contributing Member
Contributing Member
Posts: 100
Joined: Wed Oct 02, 2002 10:42 pm

Post by Consilium » Tue Aug 26, 2003 4:59 pm

I understand pound defines from my Java background but I don't understand the v... so this is just the way MQ is? And do the numbers matter or do they just have to be different? Also if I have an #include do the v's of that file have to be different?

Anyway.. I will probably answer this myself before someone answers it on these boards. Not to say you guys are slow...just stating that this is something that I should just try to see.
-SH
+Student
digitalsavior.com

Zeus
a hill giant
a hill giant
Posts: 180
Joined: Wed Feb 19, 2003 10:03 am
Contact:

Post by Zeus » Tue Aug 26, 2003 10:59 pm

Correct is a MQ thingie. Not sure if i'm correct on all of this but this is what I understand. There's a finite number of posible variables, v0-v99 v are normal variables, p are parameters, a are arrays, etc. The #define is what it's called a macro in C/C++ whenver it finds an occurrence of that test it substitutes for your macro. You don't need to define any variables they always exist, but if you want to give em a name to make it easier to read/debug then you use em. A good programming practice.