home *** CD-ROM | disk | FTP | other *** search
- Report Host Documentation
- Sep 1, 1989
-
-
-
- WHO:
-
- Copyright © 1989 by Donald T. Meyer, Stormgate Software
- All Rights Reserved
- This function host may be freely distributed via BBS and Freeware
- collections on diskette.
- Commercial use is with the written consent of Donald T. Meyer only.
-
- Stormgate Software
- P.O. Box 383
- St. Peters, MO 63376
-
- E-Mail can be sent via the following:
- BIX: donmeyer (almost daily)
- GEnie: D.MEYER (weekly)
- PLINK: Stormgate (weekly)
-
-
-
- WHAT:
-
- An ARexx function host.
-
-
-
- DESCRIPTION:
-
- This ARexx function host, which is written using my freely distibutable
- function host source code (available on various communications services),
- contains a set of functions dealing with displaying "report" text.
-
- The intent of the "report" functions is to give ARexx programs a
- standard way of displaying "verbosity" type messages. The report level
- would be set by the user (via -v5 etc. cmd. line opts?) to control
- just what the ARexx program displayed. For example, level 1 would be
- very detailed progress/status messages, level 5 would be general
- progress messages, and level 10 might be non-fatal errors.
-
- Why do I feel the need to do these sorts of things? Well, in 'C' for
- example, a global variable is truly global. ARexx on the other hand
- does not allow you access to "global" variables in a procedure unless
- you EXPOSE them. For verbosity reports, which may be displayed from
- any point in any ARexx function, this limitation (or feature!)
- gets annoying.
- This function host allows the "global" data, i.e. report stream and level
- to be stored external to the ARexx program. As an added benefit, if you
- open the scrollback window, the text will remain after the ARexx program
- has exited. This is handy for ARexx macros launched from the WorkBench.
-
- Please send me any bugs, comments, or suggestions that you care to.
-
-
-
- TO USE IT:
-
- Merely type "report_host" at a CLI, or double-click from WorkBench.
-
- When executed, this function host will detach and run in the background
- (if started from a CLI, there is no need to "run" or "runback" it).
- It will automaticly add itself to the ARexx library list.
- This may be started from either CLI or WorkBench, and the normal stack
- size of 4096 is just fine.
- Once running, the various functions defined herein are accessible
- simply by using them in any ARexx program.
-
- For more information on ARexx Function Hosts, see Chapter 6 in the
- ARexx manual.
-
-
- To remove it, simply type "report_host -q" from the CLI, or start it from
- the WorkBench again. It will take itself off of the ARexx library
- list and remove itself from memory.
-
-
-
- LIST OF FUNCTIONS:
-
- SETREPORT()
- ENDREPORT()
- REPORT()
-
-
-
-
- **********************************************************
- ** **
- ** Function Descriptions **
- ** **
- **********************************************************
-
-
-
- ----------------------------------------------------------------------
-
- SETREPORT()
-
-
- call setreport( level, [stream], [header text] )
-
- Set the reporting level for messages from the ARexx program.
- Level is a number used to control which messages display.
- Stream may (currently) be either null or "GLOBAL". If null, the
- report text will first go to the ARexx programs "*" console. If
- this is not available, the text will be sent to the report host's
- stream. The report hosts stream will be the CLI the report host was
- started from, or, if that is not available, the report host will open
- it's own window. If the environment variable "REPORT_HOST_OUT" is
- set to "scrollback" than a window which allows reviewing historical
- text that has scrolled off will be used.
- Header text if set will preface all report text.
-
-
-
- ----------------------------------------------------------------------
-
- ENDREPORT()
-
-
- call endreport( [ALL] )
-
- This should be called at the end of every ARexx program which
- calls setreport(). This will free up the data allocated and close
- the output stream if neccessary.
-
- In some cases, an ARexx program will terminate in a fashion which
- does not allow an endreport() call to be made. If this occurs,
- a small amount of memory which was allocated to store information
- about the ARexx program will not be freed. Usually this is not a
- great concern.
-
- If the ALL keyword is given, this will be done for EVERY program
- which has ever setreport()'ed. This should only be done if it
- is neccessary to clean up for some programs which may have exited
- without cleaning up for themselves.
-
-
-
- ----------------------------------------------------------------------
-
- REPORT()
-
-
- call report( level, text )
-
- This will cause the text to be displayed if the 'level' is equal to
- or greater than the level set via a call to setreport().
-
-
- Example report usage:
-
- call setreport( 5, , "My program says" ) /* Send report text
- * to the ARexx pgms.
- * "*" stream.
- */
-
- call report( 4, "Processing a new file" ) /* won't print, the
- * level is <5
- */
-
- call report( 10, "File was not processed" )
- /* Will print "My program says: File was not processed" */
-
- call endreport()
-
-
-
- ----------------------------------------------------------------------
-