VB6 - how can i create\use macros?
i have 1 nice Add-in with several tools\classes(adding the DLL auto on references ;) ).
my question is how can i add\create macros?
i need create a similar '#define'(like C)..
pratical exemple:
your wrote:
Code:
SubName(...) 'VB6 give a syntax error
so the macro just add the 'call':
Code:
call SubName(...) 'VB6 now accepts
is why i need macros on VB6 ;)
Re: VB6 - how can i create\use macros?
Quote:
Originally Posted by
joaquim
VB6 - how can i create\use macros?
You don't.
there are 3 common uses of #define in c
1) defining constants --> IIRC, typeless, but you can cast the value to a specific type to force byte-width. Optional: With value (the "classic")/without value (e.g. the famous "Header"-Define to prevent multiple loading of header-files)
2) defining TypeDefs --> "renaming" of a Datatype (My personal opinion: Whoever invented that deserves Jail-Time)
3) defining "macros" --> short, usually typeless, piece of "code"
alle 3 have in common:
a) It gets resolved at compile-time
b) the c-compiler "inserts" (replaces) the "caller"-Symbol(s) inline at all calling positions
The "worst" for Number 3 i've ever seen, are those "stringify"-macros