Once I know how to just get a list going, I can separate everything into its respective group/base/files for output. I'm just stuck because I'm
not sure how to access the files and descriptions themselves.
To list files you have to call "fl_open" and pass it the filename of the filebase you want to open. After that you call "fl_seek" to the start of the database and then you loop through it:
# open file base
flist = fl_open("filename")
# if it didn't work exit
if flist is None:
writeln("Open failed")
quit()
# start at beginning of file list
fl_seek (flist, 0, true)
# whenever we seek to a file or ask for the next or previous file in the
# file base, the fl_found will be set to true or false to tell us if the call
# found a file. So we need to loop by checking fl_found:
while fl_found(flist) and not shutdown():
# call getfile to get the next file data into fileinfo
# and then print the filename
fileinfo = fl_getfile(flist)
writeln("File: " + fileinfo["filename"])
# calling getfile only returns the base file information not the
# description, so if we want to get the description for the file we need
# to call getdesc which returns the description (ANSI descriptions are
# converted to pipe colors)
filedesc = fl_getdesc(flist)
# now that we have the file description, loop through it and print it out
for line in range(1, fileinfo["lines"]):
writeln(filedesc[line])
# ask for next file and then let it loop to the top again
fl_next(flist)
# when we get here its because fl_found was false meaning there were no
# more files found, so we close the file list
fl_close(flist)
[SNIP]
To pseudocode it:
1. Open file base
2. Seek to start of database
3. Do we have a file? (fl_found)
4. If yes: Read file, print filename, ask for next file. Goto 3.
5. close file base
--- Mystic BBS v1.12 A45 2020/02/15 (Windows/64)
* Origin: Sector 7 (21:1/108)