You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
Hi Pat.
Thanks for the tip. I have tried every possible combination
but my poor little PB 2.1f just won't cut it. " The example
that I gave above is my final (out of several) attempt(s) to
get around this. If you were to take every DIM and REDIM in
it and juggle it around, I tried it.
------------------
Leave a comment:
Guest replied
Mel,
Look at REDIM vs DIM with PASSED ARGUMENTS. I had the same problem
and received excellent help from Lance Edmonds.
Pat Bruening
------------------
[This message has been edited by Pat Bruening (edited January 16, 2001).]
PB2.x and FirstBasic do not allow arrays to be redimmed from subs/functions if the array was passed as a parameter. It seems that the error was omitted from the documentation, as I confirmed with my PB2.10f manual set.
However, PB3.5 does allow passed arrays to be redimmed, provided the arrays are not STATIC (STATIC is the default array type).
Using SHARED arrays works with all versions of PB/DOS and FirstBASIC.
I was in the process of "cleaning up" some of my programs and
ran across somewhat of a head-scratcher. I am using PB 2.1f for
DOS.
If I use the following procedure, I get an
"Error 599: Parameter arrays may not be altered", which isn't in
the book that I have.
It errors out on the REDIM statement.
sub make.set(a&&,b$(),c,d)
redim b$(c)
...
...
end sub
On the other hand, if I go this route:
sub make.set(a&&,c,d)
shared b$()
redim b$(c)
...
...
end sub
It compiles and runs as advertised. Anybody know the why's and
what-for's of whats happening 'cause I sure don't? Thanks.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: