/*
Copyright (C) 2002 J.E. Gilpin
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

$VER: 1.0 Jabberwocky.awebrx (5/5/02) $Id: Jabberwocky.awebrx,v 1.1 2003/11/01 10:14:20 carrott Exp $
ARexx Script to open Jabberwocky from AWeb

Due to the stack requirement of MUI Class NList.mcc, Jabberwocky
cannot be run directly from an AWeb button or menu unless AWeb
has been started as a CLI command with a stack of 8000 or greater.
This AWeb ARexx script increases the stack size before launching
Jabberwocky and can be used to start Jabberwocky from an AWeb button
or menu even if AWeb's initial startup stack is less than 8000.

Copy this script to your Aweb:plugins directory.
Enter the following in AWeb>Settings>GUI Settings>Buttons:
(Select <ADD> to a new button or edit an existing button)

Label: Jabber (or any label you want to use)
Command: RUN AWebPath:plugins/Jabberwocky.awebrx

Change the variable <JabberProgram> definition (below) to match the
location of the Jabberwocky program on your system.
*/
JabberProgram = "Work:Commo/Jabberwocky/Jabberwocky"

newstack = 8192; oldstack = PRAGMA('STACK',newstack)
IF oldstack > newstack THEN newstack = PRAGMA('STACK',oldstack)

IF ~SHOW('PORTS','JABBERWOCKY.1') THEN DO
  ADDRESS COMMAND JabberProgram
END

newstack = PRAGMA('stack',oldstack)

EXIT

/*
   Version 1.1 for running two copies of Jabberwocky from one AWeb
   user buttom. To use this version you must have a second
   Jabberwocky directory with a different Jabber account saved.
   Load this script in a text editor and erase the above version.
   Then uncomment this version and save. Installation is the same.
   (don't forget to comment out the 2 lines of instructions below)
*/
/*
Change the variable <JabberProgram_x> definitions (below) to match the
location of the Jabberwocky programs on your system.

JabberProgram_1 = "Work:Commo/Jabberwocky/Jabberwocky"
JabberProgram_2 = "Work:Commo/Jabberwocky/Jabberwocky_2/Jabberwocky"

newstack = 8192; oldstack = PRAGMA('STACK',newstack)
IF oldstack > newstack THEN newstack = PRAGMA('STACK',oldstack)

IF ~SHOW('PORTS','JABBERWOCKY.1') THEN DO
  ADDRESS COMMAND JabberProgram_1
END
ELSE IF ~SHOW('PORTS','JABBERWOCKY.2') THEN DO
  ADDRESS COMMAND JabberProgram_2
END

newstack = PRAGMA('stack',oldstack)

EXIT
*/