Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 String Data Limit vs. Flexible Array
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Dragon20942




PostPosted: Sun Dec 18, 2011 5:47 pm   Post subject: String Data Limit vs. Flexible Array

What is it you are trying to achieve?
I am attempting to file each character (does not matter if spaces are included or not, but I would like to know) of a text file into a separate index of a flexible string array to avoid the max string character limit of 255.


What is the problem you are having?
I cannot isolate each letter of the text file without first creating a variable to take on the value of the entire text file, which could potentially exceed 255 in length.


Describe what you have tried to solve this problem
I tried to use "length" on the text file information (without creating a variable), but could not find the correct syntax, if one exists for that operation.


Post any relevant code

Turing:

loop %this outputs strings separated by spaces, not individual characters
new data, upper (data) + 1
get : stream, data(upper(data))
exit when eof (stream)
end loop


Please specify what version of Turing you are using
4.1.1
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun Dec 18, 2011 6:03 pm   Post subject: RE:String Data Limit vs. Flexible Array

read the docs got get, it has relevant examples.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Dragon20942




PostPosted: Sun Dec 18, 2011 6:26 pm   Post subject: Re: String Data Limit vs. Flexible Array

Was the intention to lead me to "char"? All I had to do was change my array into chars and it was all solved Very Happy Thanks!
Tony




PostPosted: Sun Dec 18, 2011 6:38 pm   Post subject: RE:String Data Limit vs. Flexible Array

that's one way, yes. You could also get content of fixed length, so you could read from a file in blocks of size at most 255. Though either approach works, and there are unique tradeoffs to each.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: