[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
InFile method usage
From: |
Rick Riolo |
Subject: |
InFile method usage |
Date: |
Sat, 6 Feb 1999 14:53:16 -0500 (EST) |
I'll have to admit I don't use the Swarm input/output
objects much...I just use my old c routines.
That said, I have a couple of questions/possible suggstions
about InFile methods:
1. Does a method like getDouble (&friends) span
white space (blanks,tabs,newlines)
before deciding if the next token is a double, and if so,
loading it into the given double variable?
If not, I would suggest that it be changed to do that.
It would be so much more useful, I think.
2. Does getDouble accept values like
22 32 4444
as valid double values?
3. If input looks like:
333.3 abc 4443.3
and I send three getDouble messages to anInFile,
will it read 333.3 ok, return error for abc,
then read 4443.3 ok?
That is, does it leave the InFile read-point
after the "abc" after an error?
Basically, I'm trying to use the InFile methods
to (easily) read files that look like this:
# a comment line
# another comment line
1.5 2.5 3.5
11.5 12.5 13.5
# another comment line
21.5 22.5 23.5
such that it skips the comment lines, but picks
up the other values one after another as doubles.
What's the simplest way to do that?
(Maybe its just to use anInFile to read in lines,
check the first char for # and skip if need be,
otherwise use sscanf to read the values?)
Any suggestions?
(I'm trying various things, and none I've stumbled
on look very elegant).
thanks.
- r
Rick Riolo address@hidden
Program for Study of Complex Systems (PSCS)
4477 Randall Lab
University of Michigan Ann Arbor MI 48109-1120
Phone: 734 763 3323 Fax: 734 763 9267
http://www.pscs.umich.edu/PEOPLE/rlr-home.html
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.
- InFile method usage,
Rick Riolo <=