Help Wanted

blitz arrays – dark_star

dark_star

Junior Member

Posts: 9
From:
Registered: 08-18-2003
im using blitz basic and just wanted to know if there was a way
to free the memory used by an array in the middle of a program.
Krylar

Administrator

Posts: 502
From: MD, USA
Registered: 03-05-2001
Yep, just re-dim it.

Like this:


Graphics 800,600

Dim States$(5)
States$(0) = "California"
States$(1) = "Virginia"
States$(2) = "New York"
States$(3) = "Florida"
States$(4) = "Texas"

For i = 0 to 4
Print States$(i)
Next

Dim States$(0) ; this line re-dims it

Print "States is now empty"

WaitKey()

End

Hope that helps.

-Krylar

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

[This message has been edited by Krylar (edited August 28, 2003).]

[This message has been edited by Krylar (edited August 28, 2003).]

dark_star

Junior Member

Posts: 9
From:
Registered: 08-18-2003
i tried that once but thought it didnt work... thanx.
Krylar

Administrator

Posts: 502
From: MD, USA
Registered: 03-05-2001
Note that if you're using an old version of Blitz it probably won't work. I think that re-diming was busted for awhile, but I know it works in the later versions.

-Krylar

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