Conditional Compile

Discussion in 'Pascal Logic Code Examples' started by Dave Byron, Oct 18, 2010.

  1. Dave Byron

    Dave Byron

    Joined:
    Aug 3, 2004
    Messages:
    835
    Likes Received:
    0
    Location:
    Casurina
    Has there been any thought to including the Pacal $IF command into the Piced compiler ???
    Reason.
    I have a all of Popup time out logic Modules in the main project and what to only compile the modules that go with a project; ie
    Modules
    Kitchen
    Bed1
    Entry

    Then I would have;
    $IF project = ?kitchen? begin
    Compile kitchen logic
    $ENDIF


    tks
    dave
     
    Dave Byron, Oct 18, 2010
    #1
  2. Dave Byron

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    This has been in our system for years. Number 7007. It is a good idea if you are using one bit of code for more than one thing.
     
    Darren, Oct 18, 2010
    #2
  3. Dave Byron

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,397
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    Its also kinda hard to do :)
     
    ashleigh, Oct 18, 2010
    #3
  4. Dave Byron

    Dave Byron

    Joined:
    Aug 3, 2004
    Messages:
    835
    Likes Received:
    0
    Location:
    Casurina
    That's a shame as I believe it standard Pascal and available in most of the compliers I use.
    What I wanted to do was - assuming the project name is available put all the logic in one project file and group it by the C-touch - as in pic - then use a selective compile.

    Guess onto Plan B
    dave
     

    Attached Files:

    Dave Byron, Oct 18, 2010
    #4
  5. Dave Byron

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,397
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    Things like $IF and so on are really pre-processor stuff.

    Its not part of the standard language, its an extension. Different vendors do this kind of thing different ways.

    Pre-processors are cool. Just another layer of complexity to make life exciting too.
     
    ashleigh, Oct 19, 2010
    #5
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 (here). After that, you can post your question and our members will help you out.