Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / CRLF Inserted on Function Call

Author
Message
Nateholio
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: I\'ve Been Everywhere
Posted: 29th Apr 2012 07:15
Just wondering if any of you have ran into a problem which seems like DBP is inserting a LF when it calls a function.

Due to my project's growing size, I had to split everything up into includes, and so reluctantly had to make use of the new IDE. This is where the problem first started.

I can write a string to my console log before the suspect function(s) are called and it's good. However, once the strings are written from within the function (immediately after the function def) there is a LF inserted right after the string. This obviously causes problems. The code for the functions didn't change at all.

Code when the function is called and inside the function:


Output of the console log:


I checked the above in my hex editor, and the problem char is indeed a LF.

In Development: K96 - Combat Simulation
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 29th Apr 2012 20:22 Edited at: 29th Apr 2012 20:23
Quote: "Just wondering if any of you have ran into a problem which seems like DBP is inserting a LF when it calls a function."


DBP doesn't do anything like that - it can't, how could it know to insert an LF into a parameter which may not even be a string when you call a function?
You haven't posted anywhere near enough code for us to track down the error. The LF is being generated somewhere in the "Object_Get_Camera_X" after the code you posted.

[b]
Nateholio
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: I\'ve Been Everywhere
Posted: 30th Apr 2012 01:18
Did I ask anyone to track down the error? I don't recall doing so.

I was just wondering if anyone has ran into this before.

In Development: K96 - Combat Simulation
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 30th Apr 2012 02:28 Edited at: 30th Apr 2012 02:29
Well, generally people post a problem because they want to solve it... In this case the problem is with your code, not with DBPro, so nobody will have had the exact same problem, and if you don't want help solving it then thread closed!

[b]
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 30th Apr 2012 14:39
write string automatically inserts CRLF after the string I believe. To avoid that you can make your own function that splits a string into bytes and write them one by one using write byte instead.


"Why do programmers get Halloween and Christmas mixed up?"

Login to post a reply

Server time is: 2026-07-08 01:55:54
Your offset time is: 2026-07-08 01:55:54