Lance Edmonds
2003-07-10 14:51:29 UTC
Are you sure JVMD? that code works ok for me (I put some text into the
TEXTBOX control, and clicked EXIT which saved it successfully to the
CONFIG.INI file.
However, chances are that the file writing code is failing for you,
but this is not being detected as there is no error testing in the
WriteConfig() routine, and I believe that is the cause of the
confusion.
For example, the code will likely fail if the CONFIG.INI file is
already open by another program (such as NOTEPAD), as the other
application will likely place a lock on the file while it has it open,
and hence your code will not be able to open the file.
Basically, In this situation, your code makes no attempt to detect the
error, and regardless of whether the OPEN statement was successful or
not, it continues on trying to write to a file that may not be open,
which creates yet another run-time error.
In summary, I believe that adding error testing code to your
WriteConfig() routine will help here. Please refer to "Errors and
error testing" in the documentation for more info on run-time error
detection.
Thanks!
PowerBASIC Support
-------------------------------------------------------------------------
PowerBASIC, Inc. | 800-780-7707 Sales | "We put the Power in Basic!"
316 Mid Valley Center | 831-659-8000 Voice | http://www.powerbasic.com
Carmel, CA 93923 | 831-659-8008 Fax | mailto:***@powerbasic.com
TEXTBOX control, and clicked EXIT which saved it successfully to the
CONFIG.INI file.
However, chances are that the file writing code is failing for you,
but this is not being detected as there is no error testing in the
WriteConfig() routine, and I believe that is the cause of the
confusion.
For example, the code will likely fail if the CONFIG.INI file is
already open by another program (such as NOTEPAD), as the other
application will likely place a lock on the file while it has it open,
and hence your code will not be able to open the file.
Basically, In this situation, your code makes no attempt to detect the
error, and regardless of whether the OPEN statement was successful or
not, it continues on trying to write to a file that may not be open,
which creates yet another run-time error.
In summary, I believe that adding error testing code to your
WriteConfig() routine will help here. Please refer to "Errors and
error testing" in the documentation for more info on run-time error
detection.
Thanks!
If you select c:\windows\notepad.exe and clic exit, the Config.ini
file is not created or modify.
If you write any text in Textbox and clic exit or just clic exit with
textbox empty the file is created and/or modify.
I passe 4hours on this code and i not understand !!
Please help me !
Thanks
Lancefile is not created or modify.
If you write any text in Textbox and clic exit or just clic exit with
textbox empty the file is created and/or modify.
I passe 4hours on this code and i not understand !!
Please help me !
Thanks
PowerBASIC Support
-------------------------------------------------------------------------
PowerBASIC, Inc. | 800-780-7707 Sales | "We put the Power in Basic!"
316 Mid Valley Center | 831-659-8000 Voice | http://www.powerbasic.com
Carmel, CA 93923 | 831-659-8008 Fax | mailto:***@powerbasic.com