Announcement

Collapse
No announcement yet.

PUBLIC and EXTERNAL in PBDOS

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

  • PUBLIC and EXTERNAL in PBDOS

    Hey Lance,

    When and how do I use PUBLIC and EXTERNAL statements?
    Can you explain with an example

    Greetz
    Stephane


    ------------------
    ICQ: 123632482

  • #2
    It is explained in the docs (RTM!), but briefly:

    Lets say you are writing a UNIT and you want to use a global (SHARED) variable that is declared in the main code.

    You declare the variable in the UNIT code as EXTERNAL, and mark it PUBLIC in the main code.

    Now when the compiler does it's magic, it automatically sets the appropriate variable scope for the named PUBLIC/EXTERNAL variable(s).

    For more info, please consult the Reference Guide...

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Hey guy,

      Thanks for your help

      Greetz
      stephane



      ------------------
      ICQ: 123632482

      Comment

      Working...
      X