Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
adding a wildcard
#1
Thanks for the replies from last time. It worked. Now I'd like to enter a wildcard while running the program. The user (yes, that's me) should be able to enter something like texto?.txt for the replacement for one character, and *.bwl for the replacement of more. Therefore, it should search for existing filenames.

> that is question 1: how to search for existing names without getting a error?

For more characters (*) the situation is going to be even more complex, I think. How to handle that?
Reply
#2
Well, let's go step by step. To check if a file exists not having a error...

http://faq.qbasicnews.com/?blast=FileExists
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#3
speaking of wildcards, did you know that I once accidentally added an illegal character ("?") in a filename in dos accidentally, which made it impossible to delete in windows??
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
#4
the child is still weaker than the parent.
ammit potato!
Reply
#5
lol@potato......
VERY RIGHT!!!
'm so lazy... no really.... i am the laziest programmer ever ... ever.
Reply
#6
Quote:Well, let's go step by step. To check if a file exists not having a error...
http://faq.qbasicnews.com/?blast=FileExists
I must admit that the sample code is cute. But, it doesn't take into consideration the case when the file is a zero-length-file, which give a lot of programs grief, and which should be considered as NOT EXISTING. The above routine will claim that it exists.
*****
Reply
#7
Quote:
na_th_an Wrote:Well, let's go step by step. To check if a file exists not having a error...
http://faq.qbasicnews.com/?blast=FileExists
I must admit that the sample code is cute. But, it doesn't take into consideration the case when the file is a zero-length-file, which give a lot of programs grief, and which should be considered as NOT EXISTING. The above routine will claim that it exists.
*****
Sorry, I spoke to soon. :oops: Looking at Natha's suggested code more carefully, I noticed that a zero-length-file will be detected and treated as not existing.
Reply
#8
Try take a look on http://www.ctyme.com/rbrown.html and look for Interrupt 21h AH=4Eh and Interrupt 21h AH=4Fh.

It are the interrupts for searching files.
Reply
#9
Ok, I understanded the simple (FAQ) code. I also have taken a look on the website with interrupts. Only think I should know more about interrupts to understand it. But the site really is extended...
Reply
#10
De site is een Interrupt-Lijst, het bevat dus alle interrupts en hun omschrijving, input en output. Om interrupts te kunnen gebruiken moet je een type van RegType of RegTypeX maken (zitten in QB.BI) en die bevat de registers die je nodig hebt. Dan call je de functie INTERRUPT (zit ook in QB.BI en QB.LIB) en die voert de interrupt uit.

For english reading people: sorry, but since I can type faster in Dutch I had to post this in Dutch because I don't have much time left...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)