Click to See Complete Forum and Search --> : Does VB have an equivelant to VC's '#define' statement?


Alexandra
October 12th, 1999, 01:17 AM
Hi!
I need something that look likes to #define in VC:
#define DEF1 some_variable

How can I write this in VB?
Thanks!
Alexandra

Lothar Haensler
October 12th, 1999, 01:57 AM
VB does NOT have a precompiler, but you can use the

#CONST DEF1 = some_value
#if DEF1 = some_value then
..
#end if



syntax.

Alexandra
October 12th, 1999, 03:09 AM
Hi!
The idea is to change this code:

dim x
dim val1

x = val1
if x = ... then
'...
endif




to

' x not declared
dim val1

x = val1
if x = ... then

endif



I don't want to declare variable twice!
I the C-code I have lot of defines!(It look likes

#define factorsblender cnt.PIDFctors[10]
#define factorschargeblender cnt.PIDFctors[16]
#define factorsplc5 cnt.PIDFctors[94]
...

It explain me what a data is.
Have you any idea?
Thanks!