Qbasicnews.com

Full Version: file searching
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello, im making an rpg maker with tile, map and event editors. Now for bringing up tiles,maps etc.i would like qbasic to search a directory, i know that qbasic has a dir(dos shell) command, but i want to make it sort of a windows deal were it will only show the files you are looking for with out the dos shell look! do you have any suggestions?

Anonymous

sure, do something like:


Code:
shell "dir *.bas -> parse_me.txt"

assuming you were looking for 'bas' files.

the '->' operator will pipe the dos command to a text file, now all you have to do is open "parse_me.txt" for input as #1, and input the values that you need =)

just run that command once to see what the txt file looks like, youll have to discard some values, but theres a pattern youll be able to find. making the gui part is your homework ;p
ok! thanks for the info! 8)
cool man! you are a life saver!

but if u use the suffix /b there is no other info just file names

LOL i cheated! and you rock! :rotfl:
Code:
SHELL "dir *.bas/b > me.txt"
Quote:cool man! you are a life saver!

but if u use the suffix /b there is no other info just file names

LOL i cheated! and you rock! :rotfl:
Code:
SHELL "dir *.bas/b > me.txt"
The result of DIR vary depending on the language.. and the default settings..

For example you can set it to ALWAYS pause when it hits a "new page" and wait for a keypress..

This is the way mine is setup for example..

This means that your program will halt until the user hits a key..
Not very good coding..

The best way is to disable all flags and parameters youi wont use by pre-pending a .

dir /-p *.*
If you're still looking at this thread, you can try this. It doesn't involve files, but it will not work in freebasic (read: windows XP or above) or such..

http://faq.qbasicnews.com/?blast=DirReplacement