Announcement

Collapse
No announcement yet.

Scratching My Head

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

  • Scratching My Head

    Over this one until I'm bald (been bald for 30 years). Compile time error 415 "statement expects = sign", but with other's code it compiles fine.

    Code:
    FUNCTION ShowDIALOG5(BYVAL hParent AS DWORD) AS LONG
      LOCAL lRslt AS LONG
    
      LOCAL hDlg   AS DWORD
      LOCAL hFont1 AS DWORD
    
    '========================= error 415 here =========================
      PBFormsRichEdit()      ' Load RichEdit
    '==============================================================
    
      DIALOG NEW hParent, "View Code", 101, 70, 391, 218, %WS_CHILD OR _
        %WS_CLIPSIBLINGS OR %WS_CLIPCHILDREN OR %WS_VISIBLE OR %DS_CONTROL OR _
        %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, %WS_EX_LEFT OR _
        %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR, TO hDlg
      CONTROL ADD PBFormsRichEdit(), hDlg, %IDC_ViewCodeTxtbx, "View Code", 0, 0, 390, _
        215, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %WS_HSCROLL OR _
        %WS_VSCROLL OR %ES_LEFT OR %ES_MULTILINE OR %ES_AUTOHSCROLL OR _
        %ES_AUTOVSCROLL OR %ES_WANTRETURN, %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
        %WS_EX_RIGHTSCROLLBAR
    
      hFont1 = PBFormsMakeFont("Courier New", 10, 400, %FALSE, %FALSE, %FALSE, _
        %ANSI_CHARSET)
    
      CONTROL SEND hDlg, %IDC_ViewCodeTxtbx, %WM_SETFONT, hFont1, 0
    
      DIALOG SHOW MODELESS hDlg, CALL ShowDIALOG5Proc TO lRslt
    
      DeleteObject hFont1
    
      FUNCTION = lRslt
    END FUNCTION
    If I change "PBFormsRichEdit()" to A& = PBFormsRichEdit() the error goes away but then I get error 461 "array not dimensioned." PBforms.Inc is included in main code.
    PS: using pbwin9
    Last edited by Walt Decker; 10 Feb 2009, 04:51 PM.
    Walt Decker

  • #2
    Make sure you also include "RichEdit.inc", because there is an

    Code:
    #IF %DEF(%RICHEDIT_INC) ' Include only if RICHEDIT.INC is included in the code
    in PBForms.inc before PBFormsRichEdit.
    Forum: http://www.jose.it-berater.org/smfforum/index.php

    Comment


    • #3
      Thanks, Jose. However I did have Richedit.inc included.

      I have the app working, but I'll be switched if I know what the problem was. It appeared that in one version the compiler recognized that pbformsrichedit is a function and in the other version it didn't. Strange.
      Walt Decker

      Comment


      • #4
        Probably you aren't using the same PBForms.inc with both versions of the compiler.
        Forum: http://www.jose.it-berater.org/smfforum/index.php

        Comment


        • #5
          No, Jose, same version of pbforms.inc. But I think I found the problem.

          It appears that if pbforms.inc is included before richedit.inc the compiler does not recognize it as a function. If pbforms.inc is included after richedit.inc the compiler does recognize it as a function. I thought it would make no difference since richedit.inc contains only equates and structures.
          Last edited by Walt Decker; 11 Feb 2009, 01:18 PM. Reason: add thoughts
          Walt Decker

          Comment


          • #6
            pbforms.inc is included after richedit.inc the compiler does recognize it as a function. I thought it would make no difference.
            It can make a difference depending on the use of #IF %DEF(xxx) statements in those two include files.

            If the two files were created to be compatible, it would not make a difference, since if either file requires the other, it would have conditionally #INCLUDEd it and defined the equate required to prevent it from being #INCLUDEd again.

            FWIW, richedit.inc has been around a lot longer than has pbforms.inc.
            Michael Mattias
            Tal Systems Inc. (retired)
            Racine WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #7
              Michael, after examining both .inc files I see that it does make a difference.

              Thanks for the info.
              Walt Decker

              Comment

              Working...
              X