Announcement

Collapse
No announcement yet.

$SEGMENT quirks?

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

  • Tom Hanlin
    replied
    As Mel suggests, it's a good idea to place $SEGMENT between major code units,
    such as SUBs or FUNCTIONs, rather than just anywhere in the middle.
    You can't use $SEGMENT within a unit, or within a structured code block
    such as FOR..NEXT, DO..LOOP, or IF..END IF. Use $SEGMENT only when you
    must-- fewer segments mean more efficient code.


    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Leave a comment:


  • Mel Bishop
    replied
    The best place to put it is the first line of an $include file.
    The $include file should contain a SUB or FUNCTION only. It's
    not a really good idea to randomly put $SEGMENT statements in
    middle of a routine.

    ------------------


    [This message has been edited by Mel Bishop (edited February 14, 2002).]

    Leave a comment:


  • Paul Panks
    started a topic $SEGMENT quirks?

    $SEGMENT quirks?

    Hey all,

    I occasionally use $SEGMENT in my longer DOS applications. But for some odd reason the
    IDE/Compiler is fussy about where and when I can place one in my code. I often have
    to randomly place $SEGMENT (and multiple times) to get it to compile.

    Paul


    ------------------
    Few cats act their age, while
    most just cough up furballs.
Working...
X