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 / How can I copy a line at a time in a text file?

Author
Message
Mark Garrett
Reviewed AGK on Steam
20
Years of Service
User Offline
Joined: 10th Jul 2005
Location: California, US
Posted: 14th Jun 2014 19:00 Edited at: 14th Jun 2014 19:01
Here's what I have so far, it copies a letter at a time. But I want to fix it so that it copies a line at a time. How could I do that?


.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 14th Jun 2014 19:28 Edited at: 14th Jun 2014 19:29
read string 1,a will read an entire line from a text file and return a string. write string will write an entire line of text to a file.

Mark Garrett
Reviewed AGK on Steam
20
Years of Service
User Offline
Joined: 10th Jul 2005
Location: California, US
Posted: 14th Jun 2014 19:39 Edited at: 14th Jun 2014 19:41
I tried that but then it produced these weird characters....


Where do the strange characters come from and how can I change them back into English?

.
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 14th Jun 2014 20:22
How about Read File?

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 14th Jun 2014 20:40 Edited at: 14th Jun 2014 20:41
What's the text file's encoding? Judging by the output it looks like unicode, and I think DBP only supports utf-8 and ASCII.

@MrValentine - read file will read the entire file into a memblock - not what he's looking for.

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 14th Jun 2014 21:58
I know, but it could possibly alleviate some issues, as an alternative way, but yeah I agree with the Encoding mention...

The other question is, what created the file in the first place?

Login to post a reply

Server time is: 2026-07-06 17:11:50
Your offset time is: 2026-07-06 17:11:50