Page 1 of 1

reading a file list

Posted: Thu Jun 19, 2008 12:07 am
by stilgar
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

Posted: Thu Jun 19, 2008 8:48 am
by pebe
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.