Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
file searching
#1
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?
t is better to error on the side of caution
than the side of haste!!!
[Image: title3.jpg]
Reply
#2
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
Reply
#3
ok! thanks for the info! 8)
t is better to error on the side of caution
than the side of haste!!!
[Image: title3.jpg]
Reply
#4
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"
t is better to error on the side of caution
than the side of haste!!!
[Image: title3.jpg]
Reply
#5
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 *.*
Reply
#6
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
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)