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 / Read String Per Line

Author
Message
punkyb
7
Years of Service
User Offline
Joined: 8th Sep 2016
Playing: PC and Android Games
Posted: 15th Nov 2016 10:16
I'm trying to replicate the file command read string which it reads per line of an open file but in my case I have my data in a full multi-line string (with line feed).

I thought I could find this with Matrix1 utils but can't find any commands related to it.

Any ideas?
Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 15th Nov 2016 23:10 Edited at: 16th Nov 2016 23:50
read the file data into the mem block and then parse it (peek / poke the bytes) from there..

Code Snippets / [DBP] - ReadMemBlockString & WriteMemBlockString Functions

PlayBASIC To HTML5/WEB - Convert PlayBASIC To Machine Code
punkyb
7
Years of Service
User Offline
Joined: 8th Sep 2016
Playing: PC and Android Games
Posted: 16th Nov 2016 06:49 Edited at: 16th Nov 2016 06:50
Thanks Kevin, it seems complicated for parsing new lines by looking at the example but I'll check it out.
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 16th Nov 2016 11:19
Hi there.
Not sure if this can help...this piece of code reads all values in the same string and add to stack.




I'm not a grumpy grandpa
punkyb
7
Years of Service
User Offline
Joined: 8th Sep 2016
Playing: PC and Android Games
Posted: 16th Nov 2016 17:19
Thanks chafari, I'll check that out as well.

Login to post a reply

Server time is: 2024-03-29 00:36:21
Your offset time is: 2024-03-29 00:36:21