AmigaActive (1494/2143)

From:Neil Bothwick
Date:22 May 2000 at 22:15:36
Subject:Re: ArtEffect and loading pictures to start with... (fwd)

Sam Thomas said,

> Hello Neil

>> waitforport is a DOS command, not an ARexx statement. You haven't given
>> an "address command" statement so waitforport does nothing and the
>> script immediately tries to load the picture, before ArtEffect is
>> loaded.

> Ok, I have got a bit nearer now! I assume that the 'waitforport' command
> waits until the ArtEffect Arexx port is open? yes?
> It seems to give up waiting (about 3secs before) for the port to open before
> ArtEffect has started up. Is there a way to make the command wait a bit
> longer? atm I have just repeated the line so that it finds it the second
> time around. (this works)

Waitforport waits until the port shows or ten seconds passes. The ten
seconds is hard coded, there's no way to extend it except by running the
command multiple times.

You could use something like

do i=1 to 6 until RC = 0;'waitforport portname';end

to wait until the port appears or a minute elapses.

> what do the other commands in the script mean then?

>> /* err, script to load a picture into ArtEffect on startup*/

Initial comment, required by ARexx.

>> parse arg pic

Get the name of the picture to load from the command line

>> address command

Set the external host to an AmigaDOS shell.

>> if ~show('P','ArtEffect') then do
>> 'Run >NIL: Programs:ArtEffect/ArtEffect'
>> do i=1 to 6 until RC = 0;'waitforport portname';end
>> end

If ArtEffect isn't already running, start it up and wait for its ARexx
port to appear.

>> address 'ArtEffect' 'loadpic' pic

Tell ArtEffect to load the picture.

>> if RC > 0 then address command '"RequestChoice >NIL: "ArtEffect.rexx" "Unable to load 'pic'" "Bollox!!!"'

Put up a warning requester is the load fails.

Neil



Neil Bothwick - New Media Editor, Amiga Active Magazine
Connected via Wirenet - http://www.wire.net.uk
The UK's first Amiga-only internet access provider


A Microsoft joke (is that a tautology?)

------------------------------------------------------------------------
Failed tests, classes skipped, forgotten locker combinations.
Remember the good 'ol days
http://click.egroups.com/1/4053/3/_/468125/_/959030615/
------------------------------------------------------------------------

Quote carefully and read all ADMIN:README mails