Commodore 64 (C64) Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
?STRING TOO LONG ERROR

 
Post new topic   Reply to topic    Commodore 64 (C64) Forum Index -> Scene
View previous topic :: View next topic  
Author Message
adric22
Forum Junkie
Forum Junkie


Joined: 07 Sep 2009
Age: 37
Posts: 597
Location: Fort Worth, TX

PostPosted: Mon Jun 04, 2012 3:57 pm    Post subject: ?STRING TOO LONG ERROR Reply with quote

Lovely.. So I have this huge array of strings in BASIC. Each string is 210 characters long.

I need to save this array to a disk. No problem. I just use a small loop and a bunch of PRINT#2 statements.

The problem is when I go to load it back from the disk. I use a loop of INPUT#2 statements but I get the error "?STRING TOO LONG." After doing some research on the INPUT# command I found out that it can only handle strings up to 80 characters.

So now I'm back to the drawing board. I can think of other ways to load the data in, such as using GET#2 and reading one character at a time an appending it to a string. But that would slow things down to an intolerable speed. Any thoughts?
Back to top
View user's profile Send private message Visit poster's website
groepaz
Immortal Grandmaster of C64
Immortal Grandmaster of C64


Joined: 13 Oct 2004
Posts: 4792

PostPosted: Mon Jun 04, 2012 3:58 pm    Post subject: Reply with quote

break down each string into 3 of them?
_________________
Back to top
View user's profile Send private message
adric22
Forum Junkie
Forum Junkie


Joined: 07 Sep 2009
Age: 37
Posts: 597
Location: Fort Worth, TX

PostPosted: Mon Jun 04, 2012 4:05 pm    Post subject: Reply with quote

groepaz wrote:
break down each string into 3 of them?

I assume you mean I'd have to do this during the save routine as well as the load routine. Any way you can think of handling it without modifying the save routine?
Back to top
View user's profile Send private message Visit poster's website
groepaz
Immortal Grandmaster of C64
Immortal Grandmaster of C64


Joined: 13 Oct 2004
Posts: 4792

PostPosted: Mon Jun 04, 2012 4:11 pm    Post subject: Reply with quote

no, if you want to read it back using input, then you must make sure the strings have the proper length - or use get, which is slowass Smile
_________________
Back to top
View user's profile Send private message
malcontent
C64 Enthusiast
C64 Enthusiast


Joined: 25 Feb 2010
Age: 29
Posts: 793
Location: :noitacoL

PostPosted: Mon Jun 04, 2012 10:51 pm    Post subject: Reply with quote

Maybe poke a new start & end of basic to block save/load the variables?
_________________
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Commodore 64 (C64) Forum Index -> Scene All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Tip: Get C64 Forever for super-comfy C64 emulation with pre-installed games, demos and other goodies!


Powered by phpBB © 2001, 2005 phpBB Group