Results 1 to 4 of 4

Thread: [2005] Conditional Compilation

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2003
    Posts
    758

    [2005] Conditional Compilation

    I have a VB 2005 application that I need to compile differently based upon some parameters. This application is going to be run in 2 different branch offices with different servers. One of the things I would like to have conditional is ServerName. That way I don't have to create DSNs on the workstations.

    Along with a few constants, I also want to conditionally compile the application's name and icon.

    Any assistance would be greatly appreciated.

    PS - I am using VB 2005 Express.
    My.Settings.Signature = String.Empty

  2. #2
    Addicted Member
    Join Date
    Sep 2006
    Location
    Surabaya, Indonesia
    Posts
    163

    Re: [2005] Conditional Compilation

    Try using #if
    ex.
    VB Code:
    1. dim const a as integer=1
    2. #if a=1 then
    3. 'Put your code when a=1
    4. #else
    5. 'Put your code when a=another value
    6. #end if

    What you need is to change your constanta in order to work

  3. #3
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: [2005] Conditional Compilation

    Why not use a config file?

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    May 2003
    Posts
    758

    Re: [2005] Conditional Compilation

    Creating #Const requires me to place them into the class that they will be used from. I would prefer to have a central place to hold all conditional arguments and then use #If statements.

    I have never used a config file before. Do you have any examples? I will surf around and see what I can find.
    My.Settings.Signature = String.Empty

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width