Announcement

Collapse

New Sub-Forum

In an effort to help make sure there are appropriate categories for topics of discussion that are happening, there is now a sub-forum for databases and database programming under Special Interest groups. Please direct questions, etc., about this topic to that sub-forum moving forward. Thank you.
See more
See less

error message under PB 2.1

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

  • error message under PB 2.1

    Hi,

    I'm programing with a friend, he uses PB 2.1, I use PB 3.5 or 3.2 or PBCC.

    He has compiled code and there occurs the error message "FUNCTION in a FUNCTION".

    Whats the matter?

    I assume, that PB 2.1 does not understand "FUNTION = xyz" in a FUNCTION.

    Which restrictions are essential, I mean: If I must write code which is compatible to PB 2.1?


    Bye Elec

  • #2
    There are no compatibility issues, except at source code level, and the rules are simple enough: if it compiles, it compiles.

    Unfortunately, to get a complete list of what's changed between PB 2.1 and 3.0 you have to hand-collate the READ.ME files from PB 3.0a, 3.0C, 3.1, 3.2 and 3.5.

    I have the files for 3.2 and 3.5, but 3.0a and 3.0c were both "big ones."

    The PB 2.1 user could look at his manual. If that's been lost, I'm sure PB will sell him a FirstBASIC manual as long as he still has his 2.1 serial number somewhere.

    MCM
    (p.s.FUNCTION=value was nor supported until, I think, 3.2)


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

    Comment


    • #3
      Unfortunately, there are no printed doc's available for FirstBasic. The closest he would get would be to purchase the "Learning Basic" book which includes a "reference" section along with a free copy of PB2.1.

      That said, if Bernd's friend upgrades up to PB/DOS 3.5, he/she will get a complete set of doc's and a much more capable compiler for his money.


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

      Comment


      • #4
        Bernd,

        You are correct that PB 2.1 does not support FUNCTION= to assign the return value of a function. You must use the function name:

        Code:
        ' Adds one to the number passed to it. (Hey, it shows the principle.)
        FUNCTION AddOne%(ANumber%)
          AddOne% = ANumber% + 1
        END FUNCTION
        Alan


        ------------------
        Alan C. Earnshaw
        Information Management Systems, Inc.
        http://www.infoms.com
        Alan C. Earnshaw
        Information Management Systems, Inc.
        http://www.infoms.com

        Comment

        Working...
        X