Announcement

Collapse
No announcement yet.

Backward incompatibility?

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

  • Dale Yarker
    replied
    delete
    Last edited by Dale Yarker; 30 Aug 2008, 10:29 AM.

    Leave a comment:


  • Michael Mattias
    replied
    It's just as well that that it's only pre-defined constants. Otherwise you could inadvertently redefine some equate you forgot you had used and buried deep down in some #INCLUDE file.

    That's why I use #IF %DEF(%equate_name) a lot. Very handy.

    Still waiting (apparently) for support for '%Def (procedure_name)' but setting my own equates and using %DEF(%equate_meaning_procedure_name_is_defined) works OK.

    #UNDEF and/or #REDEF would still be useful.

    MCM

    Leave a comment:


  • Rodney Hicks
    replied
    which is pre-defined in the compiler
    Who put that there?
    Well, that's only my second mistake, first since 1962.

    Glad somebody caught it.
    Last edited by Rodney Hicks; 29 Aug 2008, 07:19 PM. Reason: add to

    Leave a comment:


  • George Bleck
    replied
    I would consider a slight language rewrite as follows:

    The value of any numeric equate or string equate which is pre-defined in the compiler may overridden if the new assignment is performed before the equate is referenced in the program

    Leave a comment:


  • Richard Angell
    replied
    Just to be clear the help file notes (What's New, Additional Changes), an equate (constant) that can be re-defined before use is one "which is pre-defined in the compiler"

    Here's the complete change remark:
    Any numeric equate or string equate which is pre-defined in the compiler may be assigned a revised value if the new assignment is performed before the equate is referenced in the program
    Last edited by Richard Angell; 29 Aug 2008, 12:24 PM. Reason: ADDED EMPHASIS ...

    Leave a comment:


  • Rodney Hicks
    replied
    They need to be defined prior to being referenced.
    They can now be redefined prior to being used.

    Leave a comment:


  • José Roca
    replied
    Yes.

    Leave a comment:


  • Paul Squires
    replied
    Looks like only subs/functions can be forward referenced, right? I tried a quick test to see if equates and types could be forward referenced and I don't think they can. They need to be defined prior to being referenced. Am I correct in saying that?

    Leave a comment:


  • Kev Peel
    replied
    Yes it's a new restriction due to the forward-referencing feature.
    Simply move the constant(s) outside of a FUNCTION or SUB and the code will compile fine.

    Leave a comment:


  • Gösta H. Lovgren-2
    started a topic Backward incompatibility?

    Backward incompatibility?

    Compiles In PBWin 8 but Not In PBWin 9
    Error 543 - Must be outside Sub/Function

    '
    Code:
    #Compile Exe  
    #Include "WIN32API.INC"
    Sub test_Include 
        %Top = %MB_TASKMODAL 'keep for older msgbox msgs  
    End Sub
    Function PBMain
      Call test_Include
      ? "Worked"
    End Function
    '
Working...
X
😀
🥰
🤢
😎
😡
👍
👎