input from file
Author |
Message |
nelson
|
Posted: 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
|
|
|
Dan
|
Posted: 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
|
Posted: 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
|
Posted: 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
|
Posted: Fri Feb 13, 2004 10:22 pm Post subject: (No subject) |
|
|
cool thx |
|
|
|
|
|
Andy
|
Posted: 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
|
Posted: Tue Feb 17, 2004 10:16 am Post subject: (No subject) |
|
|
i can use /n in turing??
and putting (249) does not work |
|
|
|
|
|
Dan
|
Posted: 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
|
|
|
|
|