Announcement

Collapse
No announcement yet.

%pb_cc32

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

  • %pb_cc32

    I have included the following code in my program so that I can compile with either PBCC or PBWin without having to worry about the WAITKEY$
    statement. However, I get a compile error

    Error 460 in F:\... Undefined equate
    Line 228: #IF %PB_CC32
    Code:
     
     #IF %PB_CC32
          WAITKEY$
     #ENDIF
    From the PBWin 8 help file
    %PB_CC32 Pre-defined as TRUE (non-zero) in PB/CC for Windows. Defined as FALSE (zero) in other compilers.
    Am I missing something?
    Regards,
    Bob

  • #2
    In earlier versions of the compilers, %pb_cc32 was only defined in the PB/CC compilers, and did not exist in the other compilers. Either the PBWIN 8 Help is in error, or PB, Inc. has changed the way that equate is set up and used.

    Try this version of your code instead:

    Code:
    #IF %DEF(%PB_CC32)
    WAITKEY$
    #ENDIF

    Comment


    • #3
      Originally posted by Clay Clear View Post
      In earlier versions of the compilers, %pb_cc32 was only defined in the PB/CC compilers, and did not exist in the other compilers. Either the PBWIN 8 Help is in error, or PB, Inc. has changed the way that equate is set up and used.

      Try this version of your code instead:

      Code:
      #IF %DEF(%PB_CC32)
      WAITKEY$
      #ENDIF
      Better yet, put it in a function or macro:
      Code:
      FUNCTION Wait4Key() AS STRING
      '-------------------------------
         #IF DEF(%PB_CC32)
            FUNCTION = WAITKEY$
         #ENDIF
      END FUNCTION
      
      ...
      
      IF Wait4Key = "x" THEN {do something..bail-out?}
      The same idea can be used with PRINT vs MSGBOX (or just use '?')
      Software makes Hardware Happen

      Comment


      • #4
        Thank you gentlemen!
        It works great.
        Regards,
        Bob

        Comment

        Working...
        X