
-----------------------------------
adamonfire
Wed Feb 16, 2005 9:46 am

File Input/output help needed
-----------------------------------
hey,
I'm insanly stuck.  I need to figure out how to read in a file and then output all the letters that have "s" in them one word per line.  I know i'm going to need a counted loop but this thing is just driving me around the bend.  If anyone could help at all it would be greatly appreacited.

-----------------------------------
Tony
Wed Feb 16, 2005 10:41 am


-----------------------------------
first you get the data from index() function to check if the word has a "s" substring in it or not.

-----------------------------------
Martin
Wed Feb 16, 2005 10:43 am

Re: File Input/output help needed
-----------------------------------
hey,
I'm insanly stuck.  I need to figure out how to read in a file and then output all the letters that have "s" in them one word per line.  I know i'm going to need a counted loop but this thing is just driving me around the bend.  If anyone could help at all it would be greatly appreacited.

Hate to break it to ya, but the only letter that has s in it is, well, s.

-----------------------------------
cycro1234
Wed Feb 16, 2005 11:51 am


-----------------------------------
LOL

-----------------------------------
Tony
Wed Feb 16, 2005 12:05 pm

Re: File Input/output help needed
-----------------------------------
the only letter that has s in it is, well, s.
good call

var fileID:int
open: fileID, "output.txt", put
loop
   put: fileID, "s"
   exit when Rand.Int(0,10)=10
end loop
close: fileID

 :wink:

-----------------------------------
Drakain Zeil
Wed Feb 16, 2005 3:39 pm


-----------------------------------
Hah! nice.

Anyway, for the WORD, make the string into variables, and do this...

Index for spaces, move in a for loop from the begining to the end, depending on what set of spaces the s is between, that is the word you use. I could imagine some other ways of doing this, but this is the first to come to mind.
