Determining EXE/IDE


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Determining EXE/IDE

  1. #1
    martin rydman Guest

    Determining EXE/IDE


    Hi!

    I have a trivial problem, but one that causes me some unnecessary problems

    I have in a module this:

    public const DebugMode=True

    This will control some stuff that *must* not happen when the program runs
    as an EXE. You can imagine how often I ship the latest beta to my customer,
    but forget to switch it to False!
    I'd like some trick that will run some code if run in the IDE and some other
    code if compiled to an EXE. In the old days (=quick basic) I'd used the CommandLine
    function, but I can't seem to find a way to place info for the command line
    from within the IDE. Am I missing something? Any other tips?

    TIA
    /Martin

  2. #2
    Eric D. Burdo Guest

    Re: Determining EXE/IDE

    You can pass command line args to the IDE via the Make tab on the Project
    Properties window... that is what we use here at ATX, and it works slick...

    --

    Eric D. Burdo, Red-Leif International
    VB Programmer and Consultant
    <http://www.redleif.com/vb>

    *** Please reply to the newsgroup so all can benefit. ***


    "martin rydman" <martin.rydman@telia.com> wrote in message
    news:39a651c2$1@news.devx.com...
    >
    > Hi!
    >
    > I have a trivial problem, but one that causes me some unnecessary problems
    >
    > I have in a module this:
    >
    > public const DebugMode=True
    >
    > This will control some stuff that *must* not happen when the program runs
    > as an EXE. You can imagine how often I ship the latest beta to my

    customer,
    > but forget to switch it to False!
    > I'd like some trick that will run some code if run in the IDE and some

    other
    > code if compiled to an EXE. In the old days (=quick basic) I'd used the

    CommandLine
    > function, but I can't seem to find a way to place info for the command

    line
    > from within the IDE. Am I missing something? Any other tips?
    >
    > TIA
    > /Martin




  3. #3
    martin rydman Guest

    Re: Determining EXE/IDE


    Thanks!

    /Martin

    "Eric D. Burdo" <vbtips@redleif.com> wrote:
    >You can pass command line args to the IDE via the Make tab on the Project
    >Properties window... that is what we use here at ATX, and it works slick...
    >
    >--
    >
    >Eric D. Burdo, Red-Leif International
    >VB Programmer and Consultant
    ><http://www.redleif.com/vb>
    >
    >*** Please reply to the newsgroup so all can benefit. ***
    >
    >
    >"martin rydman" <martin.rydman@telia.com> wrote in message
    >news:39a651c2$1@news.devx.com...
    >>
    >> Hi!
    >>
    >> I have a trivial problem, but one that causes me some unnecessary problems
    >>
    >> I have in a module this:
    >>
    >> public const DebugMode=True
    >>
    >> This will control some stuff that *must* not happen when the program runs
    >> as an EXE. You can imagine how often I ship the latest beta to my

    >customer,
    >> but forget to switch it to False!
    >> I'd like some trick that will run some code if run in the IDE and some

    >other
    >> code if compiled to an EXE. In the old days (=quick basic) I'd used the

    >CommandLine
    >> function, but I can't seem to find a way to place info for the command

    >line
    >> from within the IDE. Am I missing something? Any other tips?
    >>
    >> TIA
    >> /Martin

    >
    >



  4. #4
    Phil Weber Guest

    Re: Determining EXE/IDE

    Martin: Try this...

    Public Function InIDE() As Boolean
    On Error Resume Next
    ' The following line executes and causes
    ' an error in the IDE, but is discarded when
    ' compiled:
    Debug.Print 1 \ 0
    If Err.Number Then
    InIDE = True
    Else
    InIDE = False
    End If
    End Function

    ---
    Phil Weber



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center