Hi Michael and Lance,
thank you for advice and explanation.
Lubos
------------------
Lubos
http://web.fsv.cvut.cz/cp1250/~svobodal/basic/
Announcement
Collapse
No announcement yet.
A strange dim
Collapse
X
-
Yes, it certainly sounds like low memory condition issues.- DIM sit$(dd) --> this is a DYNAMIC array created at run-time if memory exists.
- DIM sit$(21) --> this is a STATIC array created at start-up, if memory exists.
PS: Adding $ERROR ALL ON is a good start to ensure that all possible error trapping is being utilized to help track the problems down.
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Leave a comment:
- DIM sit$(dd) --> this is a DYNAMIC array created at run-time if memory exists.
-
is a compilation error (No. 7) in the second segment (see remark) .
Error 7: Out of memory
Can be caused by dimensioning too large an array or using up all
string space.
Test/Debug procedure:
Include error handler in the section of code which allocates the arrays (the DIM statements). If you are getting error 7 there, you'll have to rethink your design. (DIM VIRTUAL can help here).
MCM
Leave a comment:
-
A strange dim
I write a little bigger program
(circa 7000 lines).
There is next segment of code in the begining:
Dd = 21
dim sit$(dd)
dim sd(dd, dd), sur$(dd), xaus(dd), sum(dd), pamet(dd, dd), pamet2(dd, dd), pamet3(dd)
dim vp(dd, dd), difer(dd, dd), d(dd), diference(dd)
dim h(dd), draft(dd), po$(dd)
dim z(dd), vrchol(dd, dd), extreem(dd), c(dd), r(dd), sum1(dd), sum2(dd)
dim bod$(16)
dim dynamic help(dd)
In the middle of program is second segment:
for I = 1 to Nsit
read A$
if eof(3) = 0 then
input # 3, B$
else
B$ = ""
end if
' permanet error "subscript out of range" appears in next line
sit$(I) = A$
A$ = REMOVE$(a$, " ")
B$ = REMOVE$(b$, " ")
if A$ <> B$ then
Neshoda2 = Neshoda2 + 1
if Neshoda2 = 1 then
locate 7, 1
call CENTRUJ ("Founded sieve errors:")
print
end if
print repeat$(11 - len(str$(I)), " "); remove$(str$(I), " "); "."; TAB(14); "sieve"; TAB(25); " Expected "; A$; TAB(45); " Founded: "; B$
end if
next I
There is a compilation error (No. 7) in the second segment (see remark) .
In fact a variable Nsit = 14. A what is strangest?
If
Dd=21
dim sit$(dd)
is changed on
Dd=21
dim sit$(21)
all work fine!
Why?
Lubos
------------------
Lubos
http://web.fsv.cvut.cz/cp1250/~svobodal/basic/Tags: None
Leave a comment: