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 / Confused about how to move data from text document to an array

Author
Message
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 28th Nov 2019 13:34
For some reason, there always ended up being a growing number of line breaks at the end of the log.
I tried fixing it by limiting how far it goes when pushing data to the file: (notice the -1)
for a = 1 to log$.length-1
But this is a messy solution which delete data if the last line fail to have a linebreak.


Qugurun
Valued Member
10
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 28th Nov 2019 16:32 Edited at: 28th Nov 2019 16:43
Good?



The fact is that when writing, line break is added. This must be taken into account.

Attachments

Login to view attachments
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 28th Nov 2019 19:30
Perfection. Thanks buddy!
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 3rd Dec 2019 14:22
You can open the file to append it, and just add a single line much more easily and quickly then reading it all in just to write it again.


Qugurun
Valued Member
10
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 3rd Dec 2019 16:15 Edited at: 3rd Dec 2019 16:16
@Bengismo perfect!

Login to post a reply

Server time is: 2025-05-25 03:45:59
Your offset time is: 2025-05-25 03:45:59