Announcement

Collapse
No announcement yet.

Error 525 on DIM A$

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

  • Error 525 on DIM A$

    It appears that the syntax is correct in the documentation but
    I get a Error 525 when I compile this code.
    PB 3.5. Is the documentation in error?

    Thanks Randy


    $DIM None
    %ISBPU=1
    $Include "RESOURCE.BI"

    DIM A$

    A$="TEST"
    Print A$

    END

  • #2
    Howdy, Randy -

    The user's manual for PBDOS 3.5, page 92, shows the statement format for variables (as opposed to arrays) as

    DIM var AS [LOCAL|SHARED|STATIC] type [,...]

    so your DIM statement was incomplete

    Regards

    Jim Martin

    ------------------

    Comment


    • #3
      Randy -

      Oops. That was the Reference manual, not the user's manual.

      And since you included $DIM NONE (which is the default condition anyways), you don't need to dimension A$ at all.

      Jim

      ------------------

      Comment


      • #4
        Jim,

        On page 93 of the Reference directory, the Remarks states that
        "IF a DEFtype statement has been used then a type identifier for
        the variable or array can be used and the "AS..." clause should
        not be used."

        So I put DEFSTR A,B,C,D in the code and get the same error. A bit
        confusing.

        I will just remember to use the method you listed.

        Thanks for your response.

        Comment


        • #5
          It appears that the syntax is correct in the documentation but
          I get a Error 525 when I compile this code.
          PB 3.5.
          ???

          "DIM A$" syntax does <U>not</U> appear to be correct according to my PB/DOS 3.5 help file:

          Code:
          Syntax to declare a variable:
          
            DIM Var AS [{LOCAL|STATIC|SHARED}] Type
          Michael Mattias
          Tal Systems Inc. (retired)
          Racine WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            Randy -

            You said

            "On page 93 of the Reference directory, the Remarks states that
            "IF a DEFtype statement has been used then a type identifier for
            the variable or array can be used and the "AS..." clause should
            not be used."

            So I put DEFSTR A,B,C,D in the code and get the same error. A bit
            confusing."

            OK. I believe that the phrase " the AS.... clause" refers only to

            AS [LOCAL|SHARED|STATIC]

            So if you've used DEFSTRING, then I think you can say

            DIM A$ type STRING, or perhaps

            DIM A$ type STRING*4

            I don't have immediate access to my PBDOS machine, or I'd try this out before responding, but I think you get my point. Give it a try.

            Jim




            ------------------

            Comment


            • #7
              Jim,

              Tried Dim A$ type String*4 and type String.. Same error message.

              Now that I understand it appears you cannot ever declare non array
              varibles with type identifiers, I am good.

              Randy

              Comment


              • #8
                Originally posted by Randy Weisman:
                It appears that the syntax is correct in the documentation but
                I get a Error 525 when I compile this code.
                PB 3.5. Is the documentation in error?

                Thanks Randy


                $DIM None
                %ISBPU=1
                $Include "RESOURCE.BI"

                DIM A$

                A$="TEST"
                Print A$

                END
                $DIM None
                %ISBPU=1
                $Include "RESOURCE.BI"

                'DIM A$ '<== Error 525

                Dim A as STRING '<=============================

                A$="TEST" ' or A="TEST"
                Print A$ ' or Print A

                END




                ------------------

                Comment

                Working...
                X