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 Discussion / Writing long

Author
Message
Jigga
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location:
Posted: 28th Dec 2002 21:43
How do you write a very long paragraph to a file?
I know how to write short words to a file, by doing this..

rem
rem
rem writing to a file
sync on
sync rate 30

do

if upkey()=1 then open to write 1, "box.x"
if upkey()=1 then write word 1,abcdefg

sync
loop



rem
rem
When I do this, abcdefg is writen in the new file (inside). I check the file by opening the x file in notepad. How do you write a long, long, long file such as

abcdefghijklmnopqrstuvwxyz44ouaosuo8uas98fuda98ufoiaufsoiahsjkfhkasfhkjafhjklhafjkhkjasfhkjsahfjksahdfkjhsajkfhkashdkshakjhakfhjksahkhsak


I know this may seem silly, but I need to know how to do this. You will see later why I needed to know this.
HAL
21
Years of Service
User Offline
Joined: 28th Aug 2002
Location:
Posted: 29th Dec 2002 00:43
HAL
21
Years of Service
User Offline
Joined: 28th Aug 2002
Location:
Posted: 29th Dec 2002 00:44
file$="box.x"
if file exist(file$)=1 then delete file file$
open to write 1,file$
write string 1,"you can only have about 230 characters in a string length like this because the compile won't accept a line length of over 255 but if you want more split the string into valuables like below."
a$="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX222"
b$="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX222"
c$="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX222"
write string 1,a$+b$c$

Login to post a reply

Server time is: 2024-04-20 02:51:16
Your offset time is: 2024-04-20 02:51:16