[REBOL] Re: /command for AmigaOS ?
From: jean:holzammer:faedv-n:bayern at: 30-Nov-2000 15:51
> Heya Jean,
> HJ> I tried to call some AmigaOS system functions from /core and had
> HJ> before I invest more time on this, I'd like to know, if there will be
> HJ> official solution ?
> You get command functions for free with the Amiga version? That's not
> very nice for us that paid for the Win32 version :(
Before rumours are spread... There are no command like functions in core.
I have a small programm called watch (2KB) running in the background, that
tells the OS : send me a message whenever file xyz is modified.
When this happens watch takes file xyz and starts it as an amiga dos batch
in the shell I type:
watch file=/ram/xyz command=execute /ram/batch
in the rebol script:
write %/ram/xyz "dir > /work/dirlist.txt"
1. rebol writes the command "dir > /work/dirlist.txt" to the file /ram/xyz
that now looks like:
dir > /work/dirlist.txt
2. The OS sends a message to watch saying "the file to be observed has been
3. watch executes the command given, i.e. execute /ram/xyz
4. at execution the batch file starts the dir command that outputs the list
of the directory to the file /work/dirlist.txt
In this example I started a dos command.
But one can start an ARexx script too, of course.
And ARexx (in combination with the rxgen.library) is able to call any
function the AmigaOS API provides.
So for every OS function I'd like to call I have to write a rebol function
and an arexx script.
You can imagine that this is quite time consuming. And I will not continue
this work if there will be a port of /command to AmigaOS.
Until now I tried implemented the following functions:
Delay ; like wait
AllocVec ; allocate memory
FreeVec ; free it again
EasyRequestArgs ; opens a dialog window and returns number of button
DisplayBeep ; Flashes the screen/outputs a beep sound
MODULE [dos intuition]
for i 1 5 1 ; do this 5 times
Delay(100) ; wait 100 ticks=2 seconds
DisplayBeep(NIL) ; Flashes screen
CleanUp() ; ensures that all memory that has been allocated
using OS functions will be freed again.
I hope you could follow my explanations.