home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #3
/
amigamamagazinepolishissue1998.iso
/
bazy
/
amigabase-stamps
/
arexx
/
emptyabserver.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-03-11
|
5KB
|
168 lines
/* AmigaBase <-> FinalWriter © 1995 Mads Lie Jensen
VER$ 1.0 28.02.1995
Use this script from inside FinalWriter
Purpose:
Used to retrieve some data from an AmigaBase Project, normally an
address, but it doesn't actually matter, which data you recieve.
The text retrieved is inserted into FinalWriter with the Font/Size/
Style set in this script. (You can change those if you want)
Usage:
You are asked for some text to pass to your AB-function. Here you
can specify a command, (See the 'ABserver'-script), or, as normally,
you enter some parameters to your AB-function. I normally gives
every address a number in my projects, so when I need an address,
I just type in the number, and my AB-function will return the complete
address. You could of course, also just use the name of the person,
who's address you need, or whatever you like.
You need to have the script 'ABserver.rexx' in your REXX:-drawer.
This script needs to get an empty string returned, if nothing was
found, matching the text you asked for. (If anything else is returned,
this will get inserted into your document.)
The script also supports commands!
(See the ABserver-script)
*/
OPTIONS RESULTS
/* Get the filename of the Current Project of AmigaBase.
Used for the title of the Request-text window. This way you can always
see which project is currently in AB
*/
continue:
project = "REXX:ABserver.rexx"('%NAME')
IF project = '' THEN
project = '<Unnamed>'
ELSE
project = GetFName(project)
/*--------------------------------------------------------------------
Insert code to get the arguments to pass to your procedure here |
----------------------------------------------------------------------*/
/*----------------------------
End of code |
------------------------------*/
/*-----------------------------------------------------------------------------
You also have to put code in the SELECT...WHEN-loop, if you want to handle |
the return-values from the commands. If you don't do that, you cannot see |
if the command was succesfull or not. |
-----------------------------------------------------------------------------*/
/* Check if the user entered some of the commands. This is also checked
in the ABserver-script, but we also needs to know, if we want to display
the result of such a command.
*/
SELECT
WHEN RESULT = '%LOAD' THEN DO
CALL "Rexx:ABserver"('%LOAD')
/* Insert code to handle returned value here. 0 = No succes, 1 = Succes */
/* End */
SIGNAL continue
END
WHEN RESULT = '%NAME' THEN DO
RESULT = "Rexx:ABserver"('%NAME')
/* Insert code to handle returned value here. RESULT is empty if the
project has not yet been saved, else contains the file + path-name */
/* End */
SIGNAL continue
END
WHEN RESULT = '%SAVE' THEN DO
RESULT = "Rexx:ABserver"('%SAVE')
/* Insert code to handle returned value here. 0 = No succes, 1 = Succes */
/* End */
SIGNAL continue
END
WHEN RESULT = '%SAVEAS' THEN DO
RESULT = "Rexx:ABserver"('%SAVEAS')
/* Insert code to handle returned value here. 0 = No succes, 1 = Succes */
/* End */
SIGNAL continue
END
WHEN RESULT = '%QUIT' THEN DO
RESULT = "Rexx:ABserver"('%QUIT')
/* Insert code to handle returned value here. 0 = No succes,
1 = Succes, -1 = Last project was quit, and AB closed down */
/* End */
SIGNAL continue
END
WHEN RESULT = '%NEW' THEN DO
RESULT = "Rexx:ABserver"('%NEW')
/* Insert code to handle returned value here. 0 = No succes, 1 = Succes */
/* End */
SIGNAL continue
END
WHEN LEFT(RESULT,8) = '%PROJECT' THEN DO
RESULT = "Rexx:ABserver"(RESULT)
/* Insert code to handle returned value here. 0 = No succes, 1 = Succes */
/* End */
SIGNAL continue
END
OTHERWISE
END
/* Retrieve the text from Amigabase */
ret = "Rexx:ABserver"(RESULT)
/*-----------------------------------------------------------------------------
This is where you insert your commands. The returned text can be found
in the ret-variable.
-----------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------
End of your commands
-----------------------------------------------------------------------------*/
EXIT
GetFName: PROCEDURE
/* Extraxt the filename from a complete path */
pos = LASTPOS('/',arg(1))
IF pos = 0 THEN
pos = LASTPOS(':',arg(1))
RETURN SUBSTR(arg(1),pos+1)