Page 1 of 1

Cubic IDE / HW4C and DebugPrint ()

Posted: Tue Jan 07, 2014 4:31 pm
by JurassicC
A question aimed at those using H4WC IDE

Is there a way to redirect the DebugPrint() output to a standard AmigaDOS Console, rather than the CUBIC output area at the bottom of the IDE.
Reason I ask is I can crash cubic with this little code snippet

Code: Select all

Senddata (1,"CWD ".."directory"..\r\n)
ftpdata$ = ReceiveData(1, #RECIEVEALL)
DebugPrint (ftpdata$)
All other FTP commands I'm using seem to work OK so this must be getting something back from the ftpserver thats crashing the Cubic console??

Or would you suggest moving away from Cubic to say CodeBench ???

I'd be interested to read how people are getting on with CodeBench and Hollywood too ?

Re: Cubic IDE / HW4C and DebugPrint ()

Posted: Tue Jan 07, 2014 10:28 pm
by JurassicC
Edit its not the CWD Command its the ftp LIST command.
I believe there is too much data coming in with RECIEVEALL all from the server into ftpdata$, which then ends up in Cubics Console that causes GoldED to crash.
I have stopped using DebugPrint() and replaced it with a logfile in ram using a simple:-

WriteLine(1,GetTime().." "..ftpdata$)

Re: Cubic IDE / HW4C and DebugPrint ()

Posted: Wed Jan 08, 2014 1:46 pm
by airsoftsoftwair
Yes, this could be a buffer overflow although this should not happen. Unfortunately, it is currently not possible to redirect DebugPrint()'s at runtime. This can only be done during startup using -debugdevice. But of course you can just write to a console using OpenFile(1, "CON:.....") or something.