Page 1 of 1

Lists in QBASIC

Posted: Tue Nov 27, 2007 8:11 pm
by supernova
Is there any way of making a list in QBASIC that I can add to, modify or delete. Kind of like the ArrayList in JAVA or the LIST object in VB. Or would I have to hard code the damn thing.

Posted: Tue Nov 27, 2007 8:15 pm
by Mentat

Code: Select all

DIM MyArray[3]
Just dim the array, and put the length in at the end. And what ever the type is for the elements.

Re: Lists in QBASIC

Posted: Tue Nov 27, 2007 8:39 pm
by Mac
supernova wrote:Or would I have to hard code the damn thing.
You have to hard code it. There are no objects in QBasic as there are in VB. Even MSGBOX must be hard coded.

We are using "hard code" to mean "code it the hard way", I guess. "Hard code" usually refers to using internal constants rather than variable supplied by the user via INPUT or parameter files. If I code OPEN "MyFile.txt", that is "hard code". If I code
INPUT "File name"; F$: OPEN F$
That is not "hard code"

Mac

Posted: Tue Nov 27, 2007 9:46 pm
by supernova
To Mac: Dang! I thought it would be like that! Thanks

To Mentat: I should have mentioned that arrays are out of the question with this project I'm working with. Thanks though.