devxlogo

Multiple compilation constants

Multiple compilation constants

Visual Basic’s documentation does not explain how to specify more than just one conditional compilation constant in the Advanced tab of the Options dialog. The correct way is using a colon as a delimiter, as in:

demo = -1: version = 100

Note that you can only assign integer numeric values, and must use -1 and 0 for True and False respectively. An alternate way to define compilation constants is using the /D switches on the command line when launching the VB5.EXE file:

C:VB5VB5.EXE /Ddemo=-1:version=100

In this case you must not use spaces before or after the “=” and “:” symbols. If you are developing different versions of your applications using conditional compilation, you might create two or more shortcut on your desktop or Start menu, each one running the VB environment with a different set of compilation constants.

See also  Does It Make Sense to Splurge on a Laptop?
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist