PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Issue on command EndProgram()
Issue on command EndProgram()
Iniciado por guest, 23,ene. 2016 09:45 - 7 respuestas
Publicado el 23,enero 2016 - 09:45
Hi everybody,
it seems that whether i'm not too keen of using this basic Windev command, or there's a bug in its core.
I'm trying to use EndProgram(true), so i can run the code into the "Closing [name of the project]" (changing the value of a registry key, in my case)
Not only it doesn't run such code, but the process of the application is still running nicely in the task manager... What am I doing wrong? Any help would be very much appreciated
Publicado el 23,enero 2016 - 12:51
Hello Yaku

I think the error is in line 6 ?

If you post the code it will help.

Regards
Al
Publicado el 23,enero 2016 - 12:52
Hi

What happens if you replace the registry key writing by something less prone to permissions problems, like an iniwrite in the user directory?

I'm thinking that maybe there is an error that isn't displayed (because it's the program closing code)

Best regards
Publicado el 23,enero 2016 - 14:13
tried with iniwrite, no success.
here is some snippets of my code:

//zone where i call the endprogram
IF NOT YesNo("test") THEN
EndProgram(True)
ELSE
[some other code]
END

obviously i pick "No" everytime as the answer of YesNo.

//Closing NameOfMyProject
INIWrite("TEST","a","this is a test",fExeDir()+"\ est.ini")

the file test.ini was created beforehand, it was empty, and after the execution of the generated .exe of this project, it is still empty and the exe's still running in the task manager
Publicado el 23,enero 2016 - 18:03
Hey,

IF NOT YesNo("test") THEN ...

Could you make it a little bit less occult?
Are you a programmer or an author of crossword puzzles?
If your whole code looks like that, it's extremely hard to read for others ...

IF YesNo(yes,"test") = yes THEN or IF YesNo(no,"test") = no THEN
Publicado el 24,enero 2016 - 01:48
Hi

I see that you did HALF the test I was asking for

Quote
Yaku

INIWrite("TEST","a","this is a test",fExeDir()+"\ est.ini")

If your program was executed normally, it's in the program file directory, and you are not allowed to write in fexedir, which is why I was telling you to write the ini file un the USER directory

Best regards
Publicado el 24,enero 2016 - 17:37
Yaku,

you can also use the dbgEnableLog() function to create a runtime log. Which you can then analyze to see what's going on in the latest moments. Put it somewhere in your code, but of course BEFORE the EndProgram() statement,
Publicado el 25,enero 2016 - 14:50
Hi everyone,
Thanks to some help, i figured out that the problem was a thread pending, which kept the exe to close properly. Sorry if i couldn't explain myself in a clearer way, I'll try to ask for help in a more detailed way next time. Thanks for the help :)