home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 465.lha / ParM_v2.5r / ParM.docE < prev    next >
Text File  |  1991-01-05  |  21KB  |  481 lines

  1.  
  2.  
  3. Documentation for ParM
  4.  
  5.  
  6. ParM stands for Parametrable Menu.
  7.  
  8. ParM  allows  you to build your own menus in order to run all the programs
  9. you  can  have  on  one ore more disks.  This is very useful for hard disk
  10. owners  who  have  programs deeply enclosed in subdirectories.  With ParM,
  11. you  can run them without going through directories under either WorkBench
  12. or CLI.
  13. With  ParM,  you  can start programs in either WorkBench or CLI mode.  The
  14. advantage  of  WorkBench mode is that the default directory of the program
  15. you run is the one in which the program file is.  But not all programs can
  16. be run in this mode.
  17.  
  18.  
  19. Building:
  20.  
  21.     ParM  was  made using AztecC 5.0a, CygnusEd release 2, and ARexx 1.10.
  22.     File  headers  are done in such a way compilation can be launched from
  23.     Ced.  I use my own DevKit, completely rewritten since the original 1.2
  24.     version of the DevKit wasn't working at all.
  25.  
  26.     ParM  needs arp.library version 39 and req.library version 1.  I wrote
  27.     my  owns libraries for the Manx linker.  The ones used here are called
  28.     arps.lib  and req.lib.  The arps.lib provides a small startup code and
  29.     glues  for arp functions that cannot be prototyped, and the req.lib is
  30.     the reqglue.o given with CygnusEd rewriten as a library.
  31.  
  32.  
  33. Installation:
  34.  
  35.     Put  ParM  with  its  icon wherever you want, and just put the default
  36.     config  file  "ParM.cfg"  in  S:  if you use it.  If you don't, you'll
  37.     have  to  specify  the  config file in the command line or in the tool
  38.     types  of  the  icon, otherwise, you will have to cancel the requester
  39.     and  won't  have  any  menus.   Make sure you have arp.library 39.1 or
  40.     higher and req.library in your LIBS: directory.
  41.  
  42.  
  43. Running:
  44.  
  45.     It  is  recommended  to run ParM from CLI if you want your programs to
  46.     have  a default path other than the current directory and C:  which is
  47.     the case if you start it from WorkBench.
  48.  
  49. ParM can be run in two ways.
  50. 1)  You  can  attach  ParM to the CLI you are using.  In this case, if you
  51.     don't specify any of the window options, the menus will be attached to
  52.     the  CLI  window  you  start  it  from.  You may then only "Run" it to
  53.     prevent you from closing the CLI.
  54.  
  55. 2)  ParM can have its own window.  This is allways the case when it is run
  56.     from  WorkBench, but you can also tell it to open it's own window when
  57.     run  from  CLI  using  "-w"  option or any of the window options.  You
  58.     should then "RunBack" it to be able to close the CLI later.  Don't use
  59.     arp ARun with NOIO because some programs don't like it, and those will
  60.     not run from ParM.
  61.     Warning: you shouldn't run ParM with "Run >NIL: ParM" because it would
  62.     be detached from the CLI but still keep the console for  it's  default 
  63.     input and output file handles and some commands in RUN mode may  crash
  64.     if you 'EndCLI' before.
  65.     Note  that  RunBack use the C:Run command and you should place the arp
  66.     version  of  the  Run command of your C:  directory if you want to use
  67.     ParM as resident.
  68.  
  69.     ParM  have  some  options  which  are  available  for most either from
  70.     WorkBench or from CLI.  Two of them are only available from CLI.  "-w"
  71.     since  ParM  allways  open  its own window when run from WorkBench and
  72.     '-o' because it is the default when run from WorkBench.
  73.  
  74.     Option list:
  75.  
  76.     CLI        WB
  77.  
  78.     -w      (CLI only)  Open its own window rather than taking CLI's one.
  79.     -x      LEFTEDGE    Left edge of ParM Window (default 0)
  80.     -y      TOPEDGE     Top edge of ParM Window (default 0)
  81.     -d      DETAILPEN   Detail pen of ParM Window (default 3)
  82.     -b      BLOCKPEN    Block pen of ParM Window (default 2)
  83.     -c      MENUCOLOR   Color for ParM's main menu (default: Detail Pen)
  84.     -r      NODRAGBAR   No drag bar (You can't move ParM), =1 to activate
  85.     -l      LITTLE      No depth gadget, =1 to activate
  86.     -s      STACKSIZE   Default stack size for commands (not parm's stack)
  87.     -f      CONFIGFILE  Configuration file.
  88.     -o                  Redirect output to NIL: for commands in RUN mode.
  89.  
  90.     -h or anything else to get help when run from CLI.
  91.  
  92.     To  use  workbench tool types, just use the keyword followed by an "="
  93.     and the value needed.  For example
  94.  
  95.         DETAILPEN=1
  96.  
  97.     this is equivalent to
  98.  
  99.         RunBack >NIL: ParM -d1    when run from CLI.
  100.  
  101.     if you specify any of the -x,-y,-d,-b,-l,-r options when run from cli,
  102.     a window will be open and -w option is useless.
  103.  
  104.  
  105. Configuration file:
  106.  
  107.     You  will  best  understand what follows if you have in front of you a
  108.     printout of the config file supplied.
  109.  
  110.     A  configuration  file  looks  like  a structured program.  You should
  111.     indent your lines to make the file as readable as possible.
  112.  
  113.     The  default  configuration file should be in the S:  directory and be
  114.     named ParM.cfg.
  115.  
  116.     The  configuration  file defines the menus you want, and what commands
  117.     they will run.  Comments begin with a #, and continue until the end of
  118.     the line.  Upper and lowercase do not make a difference.
  119.  
  120.  
  121.     Key words:
  122.  
  123.     CMDWIN  console_name
  124.  
  125.         This  will  override  the  default console used for Command output
  126.         which is "CON:0/11/640/100/Command Window".  This should be placed
  127.         anywhere in the file but better be at top of it.
  128.  
  129.     SHELLWIN  console_name
  130.  
  131.         This  will  override  the  default console used for SHELL commands
  132.         which  is  "CON:0/11/640/100/ParM Shell".    This should be placed
  133.         anywhere in the file but better be at top of it.
  134.  
  135.     SHELLCMD  command
  136.  
  137.         This   will  override  the  default  command  used  to  create  an
  138.         interactive  shell,  which  is  AShell.   For  example, if you own
  139.         WShell,  you  can use NewWSH here.  This should be placed anywhere
  140.         in the file but better be at top of it.
  141.  
  142.     WAITCMD  command
  143.  
  144.         This  will  override  the  default command used to wait for a user
  145.         input  telling  to  close  the shell (default:  WaitReturn).  This
  146.         should be placed anywhere in the file but better be at top of it.
  147.  
  148.     TMPDIR  path
  149.  
  150.         This  will  override  the  default  temp  directory used for SHELL
  151.         scripts  which  is T:.  If your directory isn't in the root of the
  152.         device,  that is to say the dir name doesn't end with a colon (for
  153.         example  T:),  you  must  append a slash '/' to your dir name (for
  154.         example  RAM:T/).   This should be placed anywhere in the file but
  155.         better be at top of it.
  156.  
  157.     COLOR n
  158.  
  159.         This  will  set  the  foreground pen color for new items.  You can
  160.         change this as often as you want.  The arguments is the pen number
  161.         to  use.   The  default  is  window  detail pen.  If the color was
  162.         window  block pen, the item would be invisible, in this case, ParM
  163.         replaces the color with window detail pen.
  164.  
  165.     MENU menu_name
  166.  
  167.         Creates  a  new  menu.   Each  menu must have at least one item or
  168.         submenu.
  169.  
  170.     SUBMENU submenu_name
  171.  
  172.         Creates  a  new submenu.  Each submenu must have at least one item
  173.         and can't have submenus.
  174.         Each SUBMENU must end with an ENDSUBMENU
  175.  
  176.     ENDSUBMENU
  177.  
  178.         See SUBMENU.
  179.  
  180.     ITEM [{command-char}] item_name command_def
  181.  
  182.         Defines  a  new  menu  item.   Each  item  definition must have an
  183.         item_name  and  an associated command.  Each item is linked to the
  184.         current  menu  or  submenu.  An ENDSUBMENU statement tells ParM to
  185.         attach  next  items to the current menu rather than to the current
  186.         submenu.   If  any of the menu, submenu and item names may contain
  187.         whitespaces.   In this case, enclose the name in double quotes.  A
  188.         command  character may be defined for the menu item by putting the
  189.         character  after  the  ITEM  keyword  and  surround  it with {}'s.
  190.         Command syntax is decribed below.
  191.  
  192.         command_def
  193.  
  194.             Programs  can  be run in four ways:  ARUN, RUN, SHELL, and WB.
  195.             For  all modes, STACK and PRI are optionnal.  If STACK is less
  196.             than  4000  bytes, or if no stack is specified, the stack will
  197.             be  set to the ParM task Stack.  that is to say the stack size
  198.             at  time  ParM  was  run.   There's  an exception:  If ParM is
  199.             resident, ParM stack will allways be 4000 bytes.
  200.  
  201.  
  202.             1) ARUN syntax
  203.  
  204.             ARUN [WIN console_window] [STACK n] [PRI n] command [args]
  205.  
  206.             This  mode should be used for most of your needs.  The console
  207.             window  is  now optionnal.  This is a CreateProc() style mode.
  208.             Some  programs  don't  like  it,  but  there is not many.  For
  209.             example  scripts  cannot  be executed.  As a general rule, you
  210.             shouldn't  use  this  mode  for commands of the C:  directory.
  211.             Use  RUN  instead.   This mode has the same limitations as the
  212.             arp ARun command.  Actually, the console is immediately closed
  213.             after  the  program  ends.   We  hope  to  fix  this in future
  214.             release.   For example, I use this mode to Format my floppies,
  215.             and  I  see  in  a little window the format process.  Commands
  216.             cannot be redirected in this mode.
  217.             Note: The ARUN mode with a console (ARUN WIN console)  is  the
  218.             same as the old CLI mode. So, you can do a search/replace with
  219.             your  favorite  editor to  update  your  old  config file to a
  220.             version >= 2.2 of ParM. ( CLI ==> ARUN WIN )
  221.  
  222.  
  223.             2) RUN syntax
  224.  
  225.             RUN [STACK n] [PRI n] command [args]
  226.  
  227.             This  mode  creates  a  background shell.  This mode should be
  228.             used for scripts.  If the bit s of your script file is set, it
  229.             is  automaticaly sourced (No need of the execute command).  In
  230.             this mode, commands won't be detached if ParM is attached to a
  231.             CLI,  this  is  why  you  should use the ARUN mode as often as
  232.             possible.  Redirection can be done in this mode.
  233.  
  234.  
  235.             2) SHELL syntax
  236.  
  237.             SHELL [WIN console_window] [STACK n] [PRI n] command [args][;command [args]]...
  238.  
  239.             This  mode  creates an interactive shell.  This mode should be
  240.             used for scripts that needs input from the user.  If the bit s
  241.             of  your  script  file  is set, it is automaticaly sourced (No
  242.             need  of  the execute command).  One more feature of this mode
  243.             is   that  you  can  specify  several  commands  separated  by
  244.             semicolons,  ie:  CD SYS:Utilities;Dir In fact, ParM creates a
  245.             script  file in a temporary directory which is T:  by default.
  246.             So  you  can  make  a  real script file.  Type it normaly, and
  247.             then,  put  a  semicolon at each end of line, and join all the
  248.             lines.   You  can  then submit this line to ParM as a command.
  249.             If  a  command  needs  a  semicolon,  you can put it after the
  250.             override  char  '\'.   Usualy, semicolons are taken as comment
  251.             delimiters.   If  no  console  is  specified,  a  parametrable
  252.             default console will be used for the shell.
  253.  
  254.  
  255.             4) WB syntax
  256.  
  257.             WB [STACK n] [PRI n] command
  258.  
  259.             Execute  command  in WorkBench mode.  No arguments are allowed
  260.             in  this  mode.  Warning:  If STACK is specified here, it will
  261.             override the stack specified in the icon of the command.  Your
  262.             command may crash if you ask a smaller stack than in the icon.
  263.             Do it at your own risk.
  264.  
  265.  
  266.             5) CFG action
  267.  
  268.             CFG ConfigFile
  269.  
  270.             ParM  loads  the  new  ConfigFile like ParM->Open in the Menu.
  271.             Very  usefull  to  use different cfg file on different disk to
  272.             choose programs on this disk.
  273.  
  274.  
  275.     For  all  modes but WB, your command is searched first in arp resident
  276.     list  and  then in CLI Path at time ParM was run.  To know the path in
  277.     which  ParM  search  its  commands, just issue the Path command in the
  278.     requester of ParM Command command, or open a newcli or shell from ParM
  279.     and issue the Path command.
  280.  
  281.     A config file is given with ParM as an example.
  282.  
  283.  
  284. ParM commands:
  285.  
  286.     Open:       Pops up a requester asking to select the new config file.
  287.     UpDate:     UpDate the menu reloading the config file.  Usefull if you
  288.                 modify the config file while ParM is running.
  289.     Std Cfg:    Load   the   standard   'S:ParM.cfg'  configuration  file.
  290.                 Usefull  to  return in your favorite cfg when you are lost
  291.                 in one disk cfg.
  292.     Cmd Mode:   Two  modes  are available.  Simple and Shell.  The current
  293.                 mode  is  checkmarked.   This  modes  are  for the Command
  294.                 command  (see below) In 'Simple' mode, ParM will stay busy
  295.                 while your command isn't finished, where as in Shell mode,
  296.                 Command is asynchronous.  To do that, an interactive shell
  297.                 is  created,  and  your(s)  command(s)  is  (are) put in a
  298.                 startup  file.   There is an (s) because in this mode, you
  299.                 can  put  several  commands  separated by semicolons. Same
  300.                 rules as SHELL mode in config file.
  301.                 If you own WShell and use PatchDOS, you will  have  access
  302.                 to all WShell facilities. (alias, residents commands...).
  303.     Command:    Allows you to execute a single CLI command.
  304.     Change Dir: Changes ParM current directory.  Commands run in all modes
  305.                 but WB will inherit ParM current directory.
  306.     Quit:       Why? You don't like it!
  307.  
  308.  
  309. Separated commands:
  310.  
  311.   End:
  312.  
  313.     The  End command can now close a CLI in which a ParM is attached.  End
  314.     needs  EndCLI  to  work.  If there is no ParM attached to the CLI, End
  315.     will  only  do  an  EndCLI.   End  and EndCLI can be made resident for
  316.     maximum  speed.   You  can for example put ParM in your CLI-Startup or
  317.     Shell-Startup  to  have  menus in all of your CLI/Shells and you'll be
  318.     able  to  leave them with the End command without worrying about ParM.
  319.     Don't use this command in a WShell since it loads EndCLI from disk and
  320.     WShell only accept its built in EndCLI command.
  321.  
  322.  
  323.   ParMCD:
  324.  
  325.     The  ParMCD  change  the  current directory of the ParM attched to the
  326.     current  cli window.  Without argument, ParM will take the cli current
  327.     dir.  Otherwise, you can specify a directory as an argument to ParMCD.
  328.  
  329.  
  330.   WaitReturn:
  331.  
  332.     The  WaitReturn is used by the Command command if in Shell mode.  This
  333.     one  can  also  be made resident.  You can use it in your scripts.  It
  334.     just wait for the user to hit return.
  335.  
  336.  
  337. Limitations:
  338.  
  339.     Scripts won't run in ARUN mode, use RUN or SHELL mode instead.
  340.  
  341.     If  a  command  in  RUN or SHELL mode can't be started, you will never
  342.     know, except you won't see it working.
  343.  
  344.     When  attached  to  a  CLI,  commands  executed  in  RUN mode won't be
  345.     detached,  which  means that you won't be able to close the cli before
  346.     those  commands  end.  This is the same problem as if you had run your
  347.     command in a CLI with
  348.             1> Run mycommand
  349.     By  the  way,  theses  commands will have their output file handles in
  350.     this  window, and advantages can be taken from that.  You can redirect
  351.     these to NIL: or use -o option to avoid trashing of your cli window.
  352.  
  353.     ParM  can  be  made  resident only with the arp ARes command.  Because
  354.     ParM is not really pure, when it is resident, ParM duplicates its data
  355.     and bss.  Only arp make it possible to know if we are resident or not,
  356.     and  then,  ParM  will never copy its data if it is made resident with
  357.     the  commodore  method.   So  I allways use the arp Run command to run
  358.     parm  since  the  arp  Run first searches commands in the arp resident
  359.     list.
  360.  
  361.  
  362. Known bugs:
  363.  
  364.     Specified PRI in SHELL mode isn't used. Pri is allways 0.
  365.     Some commands won't run in RUN mode and some other won't in ARUN.  But
  366.     I've never found one that won't run in either of these. ???
  367.  
  368.  
  369. Future plans:
  370.  
  371. -   Decrease code size under 2 K !!!
  372. -   I  have  a  big  project that may provide a solution to have access to
  373.     ParM menus without having to activate ParM's little window...
  374. -   Make  another  version  that doesn't use req.library for poor users of
  375.     floppies only.
  376.  
  377.  
  378. Release notes:
  379.  
  380.     1.0:    Internal. Major MyMenu rework.
  381.  
  382.     1.1:    First official release. (Sent to Fred Fish)
  383.             Old CLI option changed to RB (stands for RunBack).
  384.             New CLI option added.
  385.             Config file syntax changed. (Old was MyMenu's one).
  386.  
  387.     1.4:    Internal. Option -l -d and WBRun enhanced.
  388.             Now you can run projects icons which have no file. For example
  389.             Serial, Pointer and Printer in the Prefs drawer.
  390.  
  391.     1.6:    Second official realease. 29/09/90
  392.             Code Cleanup
  393.             New CFG option added.
  394.             New 'Std cfg' menu added.
  395.  
  396.     1.7:    Internal
  397.             No more uses c16.lib, but use my owns instead.
  398.             Code size about 1.5K smaller.
  399.  
  400.     2.0:    Third Official release. 13/10/90.
  401.             ParM can now be made resident.
  402.             End command created.
  403.             Directory path string built in 'Change Dir'.
  404.  
  405.     2.1:    ParMCD command created.
  406.     2.1r:   This version uses the great req.library (r for req!)
  407.  
  408.     2.2r:   No more RB and CLI modes. New modes are ARUN, RUN, and SHELL.
  409.             STACK and PRI available in all modes but WB now.
  410.             No more need of the Run command in your C: directory.
  411.             Syntax errors in config file will now be reported with a line
  412.             and char number.
  413.  
  414.     2.3r:   You will never see again 'Workbench processes still active'.
  415.             ParM now creates a public MsgPort to handle workbench replies
  416.             and leave it if there's still messages to be replied.
  417.             Now, if your console has a close gadget, ParM will end if you
  418.             hit it. This is usefull for lucky owners of WShell.
  419.             Characters of ascii value over 127 now supported. (accents)
  420.             WAITCMD added.
  421.  
  422.     2.4r:   WB mode rewriten. STACK and PRI available in all modes now.
  423.             WB mode no more crashes if command not found. You can now run
  424.             tools that haven't an associated icon.
  425.             Memory for menus items is allocated by 1 K blocks to decrease
  426.             fragmentation.
  427.  
  428.     2.5r:   -s and -o option added.
  429.             -s (stack) is specially usefull when ParM is resident  because
  430.             in this case ParM stack is allways 4000 bytes whereas it takes
  431.             the default stack size of your cli when it is not resident. As
  432.             all commands run from ParM take as default the ParM stack size
  433.             you can specify a higher stack with this option.
  434.  
  435.  
  436. Acknowledgements:
  437.  
  438.     The  first  release (internal) of ParM was a major rework of MyMenu by
  439.     Darin Johnson.  The problem was that it wasn't possible to have MyMenu
  440.     without workbench, and program started from MyMenu didn't have a Path.
  441.  
  442.     So, lots of thanks to Darin Johnson for menu allocations and workbench
  443.     run.  The idea of attaching menus to the CLI and some other ideas came
  444.     from a friend who also made a menu but wasn't easy to configure.
  445.  
  446.     Great thanks to Olaf 'Olsen' Barthel for his update of arp startup for
  447.     manx 5.0, the code from which I made my own libs.
  448.  
  449.     Thanks  also  to  Colin  Fox  and  Bruce  Dawson  for  their fantastic
  450.     req.library.   We  encourage  every  programmers  to  use  it.   Every
  451.     professionnal  software  producers  should at least have a look at the
  452.     file requester.
  453.  
  454.     Thanks to William S. Hawes for ARexx and WShell.
  455.     Thanks to Pierre Ardichvili for his help to me and to Amiga.
  456.     Thanks to CygnusSoft and ASDG for their GREAT CygnusEd 2.
  457.  
  458.  
  459. Signature:
  460.  
  461.     S.R. & P.C.
  462.     This is not Status Register and Program Counter but
  463.     Sylvain Rougier & Pierre Carrette.
  464.     We are Frenchies so we hope the documentation is readable.  We put our
  465.     work  in  making english language comments, but it isn't allways easy,
  466.     so be fair with us.
  467.  
  468.  
  469. Donations:
  470.  
  471.     This  program is not public domain.  This program is BeerWare.  If you
  472.     use  it  or  if  you want the last revision, send a box of beer and/or
  473.     bugs report to:
  474.  
  475.         Sylvain Rougier
  476.         Coiffure W
  477.         39 rue Carnot
  478.         86000 Poitiers
  479.         France.
  480.  
  481.