Announcement

Collapse
No announcement yet.

Usage of #If 0

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Usage of #If 0

    A very simple answer I'm sure, but I see in various code samples:
    Code:
    #If 0
    ...
    #End If
    I understand what the Help tells me re #If but I cannot understand what the above usage does.
    What am I missing please?

    Ian B
    Last edited by Gary Beene; 26 Jul 2014, 12:27 AM. Reason: Code: tags

  • #2
    Basically it is a way to exclude compiling a section of code. Because "#IF 0" can never equal true, so it will always be excluded.

    You could do the same thing by rem'ing out each line too, but the #IF 0 takes less typing to block out a section of code.

    Bottom line is you can ignore code inside the #IF 0/#END IF section since the compiler will ignore it.
    "I haven't lost my mind... its backed up on tape... I think??" :D

    Comment


    • #3
      Thanks William.

      Wow1 - how fast was that - 4mins from question to answer!!

      Ian B

      Comment


      • #4
        Yes, you can abuse #If 0/#End If as an otherwise in BASIC missing block comment function. Paul Squire's Jellyfish will even display such a block as a comment.

        Comment

        Working...
        X