[futurebasic] Re: [FB] Shared files Help

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 1999 : Group Archive : Group : All Groups

From: "Phil Yates" <pyates@...>
Date: Thu, 22 Jul 1999 17:55:22 +0600
>> I have a program in PG/FB to tabulate results at gymnastic competitions and
>> would like to expand it to accept scores directly from the each event
>> rather than entering then in later at one station.
>>
>> I'd appreciate any help. What routines/modules should I be looking at so
>> that each computer will send the score to the main computer and it, in
>> turn, will accept it?
>>
>> Does anyone have suggestions for a strategy to do do this? Or small examples?
>>
>> Thanks in advance
>>
>> Stu Cram
>> Regina, Sask CAN

I've done something very similar recently, so here goes.

First, you'll have to buy Staz's AppleTalk software. You won't need Apple Events
unless you have to pass messages between two programs running concurrently on
one machine.

Second, work out what information will be gathered externally, and design your
message structure. This design work is the key to everything. For example, if
you captured data on floor exercises, the ascii message would look something
like :

@A_R1_12_F_8.6_8.2_8.4_8.1@

Broken down, this would be :

message start flag (anything unique)
Message type (make up your own structure)
delimiter
Sending Unit
delimiter
competitor number
delimiter
floor exercise identifier
delimiter
score
delimiter
score
delimiter
score
delimiter
score
message end flag

You'll need to create as many messages as you need, but think it through and
work out every possibility - although you can add messages easily, it's easier
to get the design right first.

Staz's filter does most things for you, but I would edit it slightly so that you
can log on as Server or Client - just duplicate the relevant bits of code and
comment out the bits you don't need.

(BTW, this is how you create a sculpture of an elephant. Just get a block of
granite and hack out all the bits that don't look like an elephant. But I
digress.)

Then you can log on the central machine as a Server, and wait until all the
Clients log on - create a message to tell you when they have. Actually this
isn't necessary, you can log on clients on the fly, and log them off when you
want - just create messages to tell the Server who's on and who's off.

When all the Clients are on, the Server can send out a message saying "go".

Then just idle the Server until you get a message in, route the message to be
processed by the message type/ sender/ exercise or whatever. Then send a message
back to acknowledge the message, and update the database.

You can also send out messages to each client giving any information you want,
such as overall scores, etc. You could even handle database access in the same
way - just receive a query, do the search, and send back a message with the
results.

That's it, really. Staz's filter does all the hard work for you. Grossly
underpriced at $29.50, too.

But remember three very important things.

Design, Design, and Design.

Phil.