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 / Reading each character in a text document?

Author
Message
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 10th Jul 2003 10:12
Is it possible? Here's my text document:

111111111112211111111111222222111111222222222221111111222222221122111122222112212221122222111222222222222221222222222211222222212222211111222211221111122222111122222222222222222222222222222222

(don't ask)

So how could I go through and read each character? I've been using byte value and simply subtracting 48 from it, giving me the original number. A little help would be nice, and thanks in advance to anyone who can help.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 10th Jul 2003 10:32


that'll only work if your using UTF8 or Ascii

HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 12th Jul 2003 10:08
:-s Looks interesting, I'll try it out...

ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 12th Jul 2003 14:12 Edited at: 12th Jul 2003 14:35
yuck


dim a$(1000)

load array "sss.txt",a$(0)

repeat
for i=1 to len(a$(rowa))
print mid$(a$(rowa),i);";";
next i
inc rowa
print
until a$(rowa)=""

wait key

------------------
*make sure the text file has a carriage return (or two) under the final row
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 12th Jul 2003 19:17
Even better. Thanks!

Login to post a reply

Server time is: 2026-07-21 12:49:38
Your offset time is: 2026-07-21 12:49:38