Announcement

Collapse
No announcement yet.

Error 525 on DIM A$

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

  • Horst Donath
    replied
    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




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

    Leave a comment:


  • Randy Weisman
    replied
    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

    Leave a comment:


  • Jim Martin
    replied
    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




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

    Leave a comment:


  • Michael Mattias
    replied
    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

    Leave a comment:


  • Randy Weisman
    replied
    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.

    Leave a comment:


  • Jim Martin
    replied
    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

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

    Leave a comment:


  • Jim Martin
    replied
    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

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

    Leave a comment:


  • Randy Weisman
    started a topic Error 525 on DIM A$

    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
Working...
X