Posts: 54
Threads: 16
Joined: Jan 2003
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?
Posts: 6,419
Threads: 74
Joined: Mar 2002
Well, let's go step by step. To check if a file exists not having a error...
http://faq.qbasicnews.com/?blast=FileExists
Posts: 3,368
Threads: 195
Joined: Jan 2003
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.
Posts: 394
Threads: 16
Joined: Jun 2003
the child is still weaker than the parent.
ammit potato!
Posts: 104
Threads: 8
Joined: Jun 2003
lol@potato......
VERY RIGHT!!!
'm so lazy... no really.... i am the laziest programmer ever ... ever.
Posts: 1,956
Threads: 65
Joined: Jun 2003
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.
*****
Posts: 1,956
Threads: 65
Joined: Jun 2003
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.
Posts: 1,845
Threads: 44
Joined: Aug 2002
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.
Posts: 54
Threads: 16
Joined: Jan 2003
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...
Posts: 1,845
Threads: 44
Joined: Aug 2002
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...