Subject: Labguide on Windows
From: Karl Lieberherr (firstname.lastname@example.org)
Date: Sun Oct 29 2000 - 12:13:58 EST
This is of interest to DemeterJ Windows users.
An interesting lesson on how to write platform-independent
-- Karl L.
>From email@example.com Sun Oct 29 10:21:47 2000
>From: Doug Orleans <firstname.lastname@example.org>
>Date: Sun, 29 Oct 2000 10:21:44 -0500 (EST)
>To: Bud and Lori Grise <email@example.com>
>Cc: firstname.lastname@example.org, email@example.com, firstname.lastname@example.org,
>Subject: Re: Labguide change
>Mime-Version: 1.0 (generated by tm-edit 7.108)
>Bud and Lori Grise writes:
> > Hi Doug,
> > I forgot to mention this yesterday. I had to make a
> > small change to the labguide to get it to work under
> > windows.
> > There are three places in LibrarySystem.beh where input
> > is read from the command line using
> > c = System.in.read(keyword)
> > After this there is a line:
> > c = c - 1; // to strip the trailing return!
> > I had to change this to:
> > c = c - 2; // to strip the trailing return!
> > to work with the CR/LF terminator used by windows.
>Thanks for pointing this out.
> > I haven't used java for a while, but I remember that
> > there is an idiom for a host-independent way to read
> > file input so adjustments like these aren't needed.
> > I don't recall exactly what it is -- a nesting of
> > inputBufferedReader with some other classes I think.
>Yep, the idiom is:
> BufferedReader in
> = new BufferedReader(new InputStreamReader(System.in));
>and then you can use in.readLine() to get a line of input without the
>Johan, care to fix the lab guide code?
This archive was generated by hypermail 2b28 : Sun Oct 29 2000 - 12:15:26 EST