Archived

This topic is now archived and is closed to further replies.

Visual Basic (VBA) Macro?

This topic is 5014 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In C++, you can do stuff like this: #define Something(X) ( X++; ) in order to shorten what you have to type each time... I was wondering if, hidden in Visual Basic (6) was the same kind of functionality? It does support some pre-compiling logic
#Const thing = 10

#If thing = 10 Then
    Sub thingie()
    MsgBox "Thing IS = 10!"
    End Sub
#Else
    Sub thingie()
    MsgBox "Thing IS NOT = 10..."
    End Sub
#End If
But I have not been able to find a way to do what C++ does. The above information was not easy to get hold of, so I maintain hope that a method does exist but is very obscure. Note: I would be grateful if nobody post their opinions about VB in relation to C++, C# or any other lang god knows we have enough flame wars without starting another one. Thanks. [edited by - Manip on March 24, 2004 7:01:23 PM]

Share this post


Link to post
Share on other sites
I don''t think there is (or will be in the foreseeable future).
For that case, you''ll have to write a function that does that instead (yes, with the associated extra slowness, but type checking advantage - unless the optimizer decides to inline it, then you have only advantages)

you will get the equivalent of templates in the next release, though



"I woke up sweating and clutching my pillow. Thankfully the powerful and reassuring visage of Optimus Prime staring back at me from my pillow case served to ease my frayed nerves. Like the giant robotic father I never had he always knows just what to say" - Gabe, Penny-Arcade

Alexandre Moura

Share this post


Link to post
Share on other sites
Next version? There is no next version. I refuse to use VB.Net cause its not Basic... but I'm surprised to learn that there is no macro's.

[edited by - Manip on March 25, 2004 6:56:58 AM]

Share this post


Link to post
Share on other sites