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.

AppGameKit Classic Chat / I consider readstring and writestring bugged

Author
Message
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 20th Aug 2018 15:38
Why is it that readstring command loading a regular file from note pad loads the entire file in 1 read forcing me to process it manually.

I dug in farther to find readstring and writestring uses chr(0) for end of line.

This should be using chr(13)+chr(10) to close a line.

Can this be fixed? If not it takes a very long time to process a whole file loaded in one string pass
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 20th Aug 2018 15:45 Edited at: 20th Aug 2018 15:47
Have you tried Readline() ??

https://www.appgamekit.com/documentation/Reference/File/ReadLine.htm


Even the description of ReadString States:
"Reads a null terminated string from the given file, which must have been opened for reading. Note that this can only read strings in binary form such as those written using WriteString, if you are trying to read strings separated by new lines then use ReadLine instead. "
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 20th Aug 2018 16:26
Yup.

Bengisimo pretty much covered it, but I admit it can be slightly confusing to start with.
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 20th Aug 2018 16:52
ah ill try it.

Thought it only had readstring and readstring2

Hopefully readline terminates line at chr(13)+chr(10)

Login to post a reply

Server time is: 2024-11-23 17:33:12
Your offset time is: 2024-11-23 17:33:12