[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Swarm-Support] Sending parameters via message: m()
From: |
James Keirstead |
Subject: |
[Swarm-Support] Sending parameters via message: m() |
Date: |
Sat, 13 Dec 2003 12:33:00 -0000 |
Hi,
I'm just beginning with SWARM and seem to be having trouble with some
basic syntax issues. I've searched the web but can't seem to find
anything on the most basic question - such as:
1) How do I send parameters via message: m()?
In buildActions of ModelSwarm.m I've got this code excerpt and I want to
pass parameters for getDistance X and Y.
modelSchedule = [Schedule createBegin: self];
[modelSchedule setRepeatInterval: 1];
modelSchedule = [modelSchedule createEnd];
[modelSchedule at: 0 createActionTo: aCustomer message:
M(getDistanceX:Y:)];
This will compile and run, granted with garbage numbers since I don't
actually pass anything to getDistance. I've seen reference to
[modelSchedule ... message: M(getDistanceX:Y):20:30]; but I get errors
with that syntax.
2) How do I refer to the properties of an object? I've tried
aCustomer.xPos, where aCustomer is a Swarm Object called Customer with
an internal variable called xPos, but get "request for member 'xPos' in
something not a structure or union".
Thanks for your help
Cheers,
James Keirstead
- [Swarm-Support] Sending parameters via message: m(),
James Keirstead <=