How to use /define?

S

Siegfried Heintze

I would like to create two versions of the same program without altering the
source code. Certainly in C++ (and I believe C# too) I can say

cl /D prompt

or

csc /d:prompt

on the command line and then in the source code

#ifdef prompt

#endif

Now I see that vbc has a /define for the command line. How may I access this
inside the VB program at run time (or even compile time) to do things
differently?

Thanks,
Siegfried
 
M

Mattias Sjögren

Now I see that vbc has a /define for the command line. How may I access this
inside the VB program at run time (or even compile time) to do things
differently?

Pretty much the same way, except unlike C# the symbols in VB have
values.

Vbc /define:pROMPT=1

#If PROMPT = 1
....
#End If



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top