I'm writing a program in GW-BASIC. For some reasons, I have the following error :
"Numéro de fichier illégal en 4712"
which can be translated in english by,
" illegal file number in 4712"
Here is a part of my code :
51 Chemin$ = "T:\Basic\Calculs\" + NF$
52 ON ERROR GOTO 60
53 MKDIR Chemin$
54 END
... ( a lot of code not important to solve this problem :) )
4711 CHDIR Chemin$
4712 OPEN "Intdrcrc.doc" FOR APPEND AS #3
4712 PRINT #3, "*---------------------------------------------------------------------------------------------------------------*"
4713 PRINT #3, USING "* Centre ##### \ \#######.### #######.### Intersect Droite Cercler *";IC,NC$,XC#,YC#
4714 PRINT #3, USING "* Point ##### \ \#######.### #######.### R=#######.### *";IP,NP$,XP#,YP#,R#
4715 PRINT #3, USING "* 1er Intersection M1 ##### \ \ #######.### #######.### *";I1,N1$,XM1#,YM1#
4716 PRINT #3, USING "* 2e Intersection M2 ##### \ \ #######.### #######.### *";I2,N2$,XM2#,YM2#
4717 PRINT #3, "*---------------------------------------------------------------------------------------------------------------*"
4718 CLOSE #3
4719 CHDIR "T:\Basic"
I had the same problem in previous lines, so I changed the # after "APPEND", but here, at the line 4712, changing the # doesn't solve the problem..
I hope I'm clear enough,
thank you very much for your suggestions !
:)
It seems the
Intdrcrc.docfile does not exist (although I can't be sure about that without looking at the rest of your code).What you can try is,
OPEN "Intdrcrc.doc" FOR APPEND AS #3withOPEN "Intdrcrc.doc" FOR OUTPUT AS 3and try if it gives an error. This is just to test of course. You should revert back toAPPENDlater. We want to see if the error is gone withOUTPUT. If so, it probably means, the file does not exist, as you expected it to.Secondly, you need to implement some error-handling after the
OPENcommand.What you can do is something like this,
So that we may know, something more if an error happens.