Computer Science Canada

input from file

Author:  nelson [ 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

Author:  Dan [ Fri Feb 13, 2004 3:41 pm ]
Post 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

Author:  Delos [ Fri Feb 13, 2004 6:31 pm ]
Post 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]...

Author:  Dan [ Fri Feb 13, 2004 7:55 pm ]
Post 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).

Author:  nelson [ Fri Feb 13, 2004 10:22 pm ]
Post subject: 

cool thx

Author:  Andy [ Sat Feb 14, 2004 5:06 pm ]
Post subject: 

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

Author:  nelson [ Tue Feb 17, 2004 10:16 am ]
Post subject: 

i can use /n in turing??

and putting (249) does not work

Author:  Dan [ Tue Feb 17, 2004 7:59 pm ]
Post subject: 

i bilve u can but i tink it is \n not /n, not shure tho i allways get that mixed up


: