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

Username:   Password: 
 RegisterRegister   
 input from file
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
nelson




PostPosted: Fri Feb 13, 2004 10:48 am   Post subject: input from file

hmmmmm

how would i get an input from datafile which has more than 250 letters in

one word.

if i want to just output them, i would use read.

but wut i have to do is put them in array, help! thx
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Fri Feb 13, 2004 3:41 pm   Post subject: (No subject)

u whould have to use more then one string var or get a better progaming langgue, lol.

may be somting like this:

var var1 : string
var var2 : string

get: stream, var1(249)
get: stream, var1(249)

the (249) tells it to only input 249 chars from the files
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Delos




PostPosted: Fri Feb 13, 2004 6:31 pm   Post subject: (No subject)

Or you could be a bit more bold and do this:

Determine the size of the file. (Commands exist in the File module, can't remember off hand)
Tell a position half way into it. (Or any other fraction to split the +250 char long word)
Slit the file into those two parts.
Go from there.

Essentially the same as Dan's method...but more fun!
Hmm...file splitters...where have I seen those before [subliminal hints drift over cyberspace to Method]...
Dan




PostPosted: Fri Feb 13, 2004 7:55 pm   Post subject: (No subject)

ah that may be a better way to do it, harder to code and my take longer but it whould work with any file (well almost).
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
nelson




PostPosted: Fri Feb 13, 2004 10:22 pm   Post subject: (No subject)

cool thx
Andy




PostPosted: Sat Feb 14, 2004 5:06 pm   Post subject: (No subject)

or just get a single letter at a time and put /n every so often
nelson




PostPosted: Tue Feb 17, 2004 10:16 am   Post subject: (No subject)

i can use /n in turing??

and putting (249) does not work
Dan




PostPosted: Tue Feb 17, 2004 7:59 pm   Post subject: (No subject)

i bilve u can but i tink it is \n not /n, not shure tho i allways get that mixed up
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Sponsor
Sponsor
Sponsor
sponsor
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  [ 8 Posts ]
Jump to:   


Style:  
Search: