Announcement

Collapse
No announcement yet.

Include

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

  • Include

    I have extracted the 'print' section of my program to a separate
    file. Print uses information from test(). When I try to compile,
    it fails because test() is unknown to Print.bas at this point.
    How can I get around this?

    QM.bas:
    #COMPILE EXE
    #REGISTER NONE
    #DIM ALL
    #INCLUDE "Print.bas"
    '-----------------------
    FUNCTION PBMAIN
    DIM test(1:2) as string


    ------------------
    Henning
    Henning

  • #2
    1. Pass Test() as a parameter to the print routine
    2. Since it appears test() is a GLOBAL, you can also put a GLOBAL Test() AS whatever prior to the #INCLUDE
    3. #INCLUDE the file after PBMain instead of before it; but since Test is GLOBAL and you'd still need a GLOABL statement somewhere prior to Test() 's appearance.

    Best way as far as future maintenance needs go is probably to PASS test() as a parameter.

    MCM

    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Michael, thank you.

      At the present time I'm going with your no# 2 option which
      solved my problem. I will probably change my program later on to
      where I pass the data on as a parameter. However, the #2 made
      other parts of my program possible to extract to separate
      files. Thanks.

      ------------------
      Henning
      Henning

      Comment

      Working...
      X