swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RESENT - InFile: skipLine problems


From: Marshall James
Subject: Re: RESENT - InFile: skipLine problems
Date: Tue, 26 Jan 1999 16:15:07 +0100

Hi,
disregard, it seems to work now, after some minor code modifications... sorry
James

A 14:08 26/01/99 +0100, vous avez écrit :
>>>>
Resent AGAIN due to delivery problems!

Hi,
has anyone encountered problems with the skipLine method in InFile? I've been trying to use it to allow comments in a textual configuration file, and it seems to me that skipLine does not advance the file pointer to the next line, even if it returns true when executed. Is there some constraint on the format of a line for skipLine to work? I am using a text file as below:

3
worker 1
2
1
3
2
worker 2
2
1
4
2
worker 3
...

with the following code:

id setupFile;
int hearingDistance, temp, type, loc, x, y;

setupFile=[InFile create: [self getZone] withName: "workers.setup"];

temp=[setupFile getInt: &hearingDistance];
while(([setupFile skipLine]!=0))
{
temp=[setupFile getInt: &type];
if (type==1)
worker=[frontal createBegin: [self getZone]];
if (type==2)
worker=[parm createBegin: [self getZone]];
if (type==3)
worker=[pompier createBegin: [self getZone]];
if (type==4)
worker=[medecin createBegin: [self getZone]];
if (type!=0)
{
temp=[setupFile getInt: &loc];
temp=[setupFile getInt: &x];
temp=[setupFile getInt: &y];
[worker initialiseEnvironment: centre location: loc xPosition: x yPosition: y];
worker=[worker createEnd];
[[centre getWorkers] addFirst: worker];
}
}
[setupFile drop];

--

James Marshall - Research Assistant - COTCOS Project
Institut de Recherche en Informatique de Toulouse
WWW: http://www.mk.dmu.ac.uk/~jmarshall
================================== 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 with "help" in the body of the message.



<<<<


--

James Marshall - Research Assistant - COTCOS Project
Institut de Recherche en Informatique de Toulouse
WWW: http://www.mk.dmu.ac.uk/~jmarshall
================================= 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]