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.

Newcomers DBPro Corner / Write string with null termination?

Author
Message
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 28th Feb 2014 12:46
I use write string$ a lot which ends with a standard ASCII carriage return (13)+(10). Is it possible to have strings end with null termination instead?

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 28th Feb 2014 15:51 Edited at: 28th Feb 2014 15:57



"Why do programmers get Halloween and Christmas mixed up?"
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 2nd Mar 2014 15:01
Thank you very much! Most helpful!

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 3rd Mar 2014 00:08
Quote: "Thank you very much! Most helpful!"

You're welcome

Actually there's a typo there, the null byte should be written to pos + strlen + 1, otherwise it will overwrite the last character in the string. But I suppose you already noticed that


"Why do programmers get Halloween and Christmas mixed up?"
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 3rd Mar 2014 10:05
I have not implemented it yet, I might do it today

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...

Login to post a reply

Server time is: 2024-11-23 15:03:12
Your offset time is: 2024-11-23 15:03:12