Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7187371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:49:49+00:00 2026-05-28T18:49:49+00:00

How can I do something similar to the following C code in VB 6?

  • 0

How can I do something similar to the following C code in VB 6?

#ifdef _DEBUG_
    // do things
#else
    // do other things
#end if
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:49:50+00:00Added an answer on May 28, 2026 at 6:49 pm

    It’s pretty much the same as the other languages that you’re used to. The syntax looks like this:

    #If DEBUG = 1 Then
        ' Do something
    #Else
        ' Do something else
    #End If
    

    It’s easy to remember if you just remember that the syntax is exactly the same as the other flow-control statements in VB 6, except that the compile-time conditionals start with a pound sign (#).

    The trick is actually defining the DEBUG (or whatever) constant because I’m pretty sure that there isn’t one defined by default. There are two standard ways of doing it:

    1. Use the #Const keyword to define the constant at the top of each source file. The definition that you establish in this way is valid throughout the entire source module. It would look something like:

       #Const DEBUG = 1
      
    2. Set the constant in the project’s properties. This would define a constant that is valid throughout the entire project (and is probably what you want for a “Debug” mode indicator).

      To do this, enter something like the following in the “Conditional Compilation Constants” textbox on the “Make” tab of the “Project Properties” dialog box:

       DEBUG = 1
      

      You can define multiple constants in this dialog by separating each of them with a colon (:):

       DEBUG = 1 : VERSION2 = 1
      

    Remember that any constant which is not defined is assumed to be 0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running something similar to the following code in debug mode: for (int
How can I do GroupBy multiple columns in LINQ Something similar to this in
I'm looking for something similar to this: Active navigation with jQuery - can't apply
In C# you can use verbatim strings like this: @\\server\share\file.txt Is there something similar
how can something print 3 times when it only goes the printing code twice?
In Java you can do something like: byte[] code = ReadFromClassFile(SomethingSomething.class); SendAcrossNetwork(code); And on
Suppose someone (other than me) writes the following code and compiles it into an
I have something similar to the following WHERE clause in my SQL statement: AND
How can I call a ViewResult controller action/method from jquery/javascript using something similar to
How can create a view with mutiple images, something similiar to the photo app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.