This is a sch project .wonder any can help ?
i have a file that stores ten phrases.
How do i access each phrase in random ?
thanks
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Read the strings into an array of strings. Count the number of phrases.
Generate a random array index between 0 or 1 and the number of strings. Use
this as an index into the array.
So, what language?
--
Thomas Matthews
email: mat...@stamps.stortek.com
atom fn
object phrase
fn = open("PHRASES.DAT","r")
for i = 1 to rand(10) do
phrase = gets(fn)
end for
puts(1,phrase)
Irv
>i have a file that stores ten phrases.
How are they stored? What format? Delimited how?
>How do i access each phrase in random ?
System? Language? Compiler/assembler/interpreter/whatever? We need
more information here, man.
--
----- Dig the EVEN NEWER, MORE IMPROVED news sig!! -----
-------------- Shaggy was here! ---------------
http://aardvark.apana.org.au/~phaywood/
============= Ain't I'm a dawg!! ==============