Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file does not exist, program halts, kick the cpu, start over....

Status
Not open for further replies.

intel2000

MIS
Jan 22, 2003
25
US
As you can see below, i've made a loop that helps check for errors like spelling. Since then I've also learned that humans make errors looking for their own errors.

.....So when you enter the wrong name its looking for a file that doesnt exist. I believe that is error #1. Anyways what can I do about this so the program doesn't halt??




Do while ynspelling="N"
@ 23,0 say "ENTER NAME:" get mselection function "!"
read
@ 24,0 say "SPELLING CORRECT??" get ynspelling function "!" valid ynspelling $ "NY"
read
enddo

use mselection-".ind"
copy to blah blah blah.......
 
Try something like this:

Do while ynspelling="N"
@ 23,0 say "ENTER NAME:" get mselection function "!"
read
@ 24,0 say "SPELLING CORRECT??" get ynspelling function "!" valid ynspelling $ "NY"
read

IF !FILE(mselection-".ind")
ynspelling = " "
ENDIF

enddo

use mselection-".ind"
copy to blah blah blah....... Dave S.
 
I've tried this and it seems to not even see it. Just skips right over it.....?Hmmmmmmmmmmmmmm....

Do while ynspelling="N"
@ 23,0 say "ENTER NAME:" get mselection function "!"
read
@ 24,0 say "SPELLING CORRECT??" get ynspelling function "!" valid ynspelling $ "NY"
read
IF !FILE(mselection-".ind")
ynspelling = " "
ENDIF
enddo
use mselection-".ind"
copy to blah blah blah.......
 
Sorry, my bad. I read the DO WHILE wrong.
Change:

IF !FILE(mselection-".ind")
ynspelling = " "
ENDIF

-to-

IF !FILE(mselection-".ind")
ynspelling = "N"
ENDIF
Dave S.
 
That was the first thing I tried after ynspelling=" " did not work. No matter what I set ynspelling to it runs right by it.......??
 
FILE(mselection-".ind") will work if it finds a file like that anywhere in the search path also. Try adding the full path name to it:

IF !FILE('c:\mydir\' + mselection - ".ind")
Dave S.
 
***********************************************************
THANKS SO MUCH DAVE.

Your idea worked. I had a error in my program. I was using spelling for a variable instead of ynspelling. Thank you so much for all your help!!!!!!!!!!
***********************************************************
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top