Lists in QBASIC

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
supernova
Newbie
Posts: 7
Joined: Fri Oct 05, 2007 2:10 am
Location: australia

Lists in QBASIC

Post 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.
SYNTAX ERROR ...
User avatar
Mentat
Veteran
Posts: 409
Joined: Tue Aug 07, 2007 3:39 pm
Location: NC, US

Post 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.
For any grievances posted above, I blame whoever is in charge . . .
Mac
Veteran
Posts: 151
Joined: Mon Aug 06, 2007 2:00 pm

Re: Lists in QBASIC

Post 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
supernova
Newbie
Posts: 7
Joined: Fri Oct 05, 2007 2:10 am
Location: australia

Post 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.
SYNTAX ERROR ...
Post Reply