Arexx (61/92)

From:Lorens Johansson
Date:19 Jan 2000 at 16:56:16
Subject:Re: File-Read

From: Lorens Johansson <SnorsleX@Home.se>

Hi Michael...

> I've a little problem, so I hope someone can help me :)

Sure...

> I have a Textfile witch always has the same format:
> first line has a title, second line is empty and the third line to the end
> of the file has text.
>
> how can I realize it to get a variable with the title (whithout the rest
> of text) and a variable with the text (without the title and the empty
> second line) of this file?

View WITHOUT textstyles!!!

/* Starts here! */

OPTIONS RESULTS

CALL OPEN("fil","RAM:test.fil","R")

title=READLN("fil")
CALL READLN("") /* to read the empty line without store it */

i=0

DO UNTIL EOF("fil")
i=i+1
text.i=READLN("fil")
END
CALL CLOSE("fil")

/* and then to print the results to a cli win: */

SAY title
DO i=i+1
SAY text.i
END

EXIT

/Lorens




Please have a look at my own Amiga programs at:

http://snorslex.amiga.tm

ICQ UIN: 12464032

WinErr ae1: Non MS OS detected... throwing tantrum.

--------------------------- ONElist Sponsor ----------------------------

Hey Freelancers: Find your next project through JobSwarm!
You can even make money in your sleep by referring friends.
<a href=" http://clickme.onelist.com/ad/jobswarm1 ">Click Here</a>

------------------------------------------------------------------------

ARexx mailing list - No flames, no overquoting, no crossposting. Unsubscribe: Blank mail to mailto:arexx-unsubscribe@onelist.com