reading a file list

Please use this Board for QBasic related requests ( file research, programming, etc.)

Moderators:Administrator, Global Moderator

Post Reply
User avatar
stilgar
Newbie
Posts:5
Joined:Thu Jun 12, 2008 3:42 am
Location:Michigan, USA
Contact:
reading a file list

Post by stilgar » Thu Jun 19, 2008 12:07 am

Hello all,
not sure what to call this. So here goes.

I need to read a directory and fill a menu type list with the file names.
then the user selects a filename to load.

I was thinking of using the menu code from my thread here.
http://qbasic-forum.qbcafe.net/viewtopic.php?t=587

so what i would need is how to load the array of the menu items, but the number of files is not fixed.

what I am working on,it is a invoicing program for a auto body shop. program overview.. the user creates a invoice file(new client) of the costumer (files will be named by costumer name). then each day as he works on the costumer car, he edits the invoice with parts and labor time.
at the start of the day the user selects "load invoice", a menu loads with the file names, and the user selects one to edit for the day.

thanks
I don't want to achieve immortality through my work. I want to achieve it through not dying.

pebe
Full Member
Posts:33
Joined:Tue Apr 02, 2002 12:19 am
Location:Scotland

Post by pebe » Thu Jun 19, 2008 8:48 am

There is a library with good documentation called ADVBAS which you can download from here.

http://pages.sbcglobal.net/oasys/dnldfr.htm

It contains a routine 'Findfirsf' which if you supply a drive letter and suitable wildcards will find the first file in that range on the disk.

Subsequent files can be found with 'Findnextf'. ADVBAS has several other useful routines - one I use a lot is 'If exist' to see if the file you want exists on the drive.

Post Reply