Debug file - location

Just starting out? Need help? Post your questions and find answers here.
User avatar
zxretrosoft
Enthusiast
Enthusiast
Posts: 169
Joined: Wed May 15, 2013 8:26 am
Location: Czech Republic, Prague
Contact:

Debug file - location

Post by zxretrosoft »

Hello friends,
one beginner question. Please, when I use Debug() command in program, and when I compile this program, where is the output file?
Thank you!
I apologize in advance for bad English
https://zxretrosoft.cz/
fryquez
Enthusiast
Enthusiast
Posts: 369
Joined: Mon Dec 21, 2015 8:12 pm

Re: Debug file - location

Post by fryquez »

Debug ProgramFilename()

Or if you want to have a debug.log use SaveDebugOutput()
User avatar
zxretrosoft
Enthusiast
Enthusiast
Posts: 169
Joined: Wed May 15, 2013 8:26 am
Location: Czech Republic, Prague
Contact:

Re: Debug file - location

Post by zxretrosoft »

Thank you, but I can not do it...
I have in program:

Debug("Hello!")
Debug ProgramFilename()

or

Debug("Hello!")
SaveDebugOutput("C:\temp\name.txt")

And not one case works :|
I apologize in advance for bad English
https://zxretrosoft.cz/
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1252
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: Debug file - location

Post by Paul »

Debug("Hello!")
SaveDebugOutput("C:\temp\name.txt")
Works here on Windows PC.

Do you have access rights to save in that location and you have the debugger turned on when you use Compile/Run button?

If you are compiling to EXE and then running the EXE, you won't get debugger output because debugger isn't compiled into EXE.
Image Image
User avatar
zxretrosoft
Enthusiast
Enthusiast
Posts: 169
Joined: Wed May 15, 2013 8:26 am
Location: Czech Republic, Prague
Contact:

Re: Debug file - location

Post by zxretrosoft »

Yes, it works.
But if I make an EXE and run it, then does not work.

EDIT: Aha, thank you very much!
I apologize in advance for bad English
https://zxretrosoft.cz/
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1252
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: Debug file - location

Post by Paul »

Maybe the OnError library might help you for compiled EXE's ?

Take a look at that in the PureBasic help file.
Image Image
User avatar
chi
Addict
Addict
Posts: 1034
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: Debug file - location

Post by chi »

Run following code in Debug mode, go to %USERPROFILE%\AppData\Local\Temp and search for PureBasic_Compilation?.exe

Code: Select all

Debug "hello"
CallDebugger
CallDebugger is only called to prevent the console window from closing...
Et cetera is my worst enemy
Post Reply