home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
wordperf
/
macade41.arj
/
BRINGBAK.DOC
< prev
next >
Wrap
Text File
|
1991-08-15
|
8KB
|
166 lines
BringBak.wpm
Enables Information from an External
Process to be Imported into WordPerfect
by
Jeffrey S. Kane, Ph.D.
Performance Sciences International
Summerfield, NC
1. Read the REGISTER.doc, LICENSE.doc, and WARRANTY.doc files distributed
with this macro.
2. Requires:
A. WordPerfect 5.1
B. Access to AutoBak.exe and USendBak.exe somewhere on the user's
system (i.e., on either a floppy or hard drive).
3. Features:
A. Enables up to 120 characters to be imported back into a
WordPerfect variable from an outside program or process.
This information may consist of such items as:
1) A computational result
2) A data base element retrieved by an external
program.
3) The location and name of a results file produced by
an external program to enable its immediate
importation to WordPerfect.
4) The optimal location (i.e., drive) to which to
export a file in terms of space availability,
proximity of similar files, etc. (This information
could be quickly determined by external utilities
and returned to a macro that would then write out
the file.)
5) The status of the system and its peripherals.
B. While obtaining information such as that described above
by manually executing the necessary processes and typing
in the information to be brought back to WordPerfect
would be very useful in some circumstances, even more
exciting possibilities lie in automating such a process
through a combination of macros, batch files, and
external programs. For example, each of the categories
of information listed under A (above) could be generated
and retrieved automatically for use in the preparation,
storage, and reproduction of documents.
The data to be brought back from external processes
may be entered either manually on the command line of the
.exe program that accomplishes the importation, or the name
of a file containing the data may alternatively be entered.
C. Two forms of the external importation program, AutoBak.exe
and USendBak.exe, allow the user the choice of either being
automatically returned to WordPerfect after the data is
imported or having the option to issue the necessary EXIT
command at any point desired after the data is imported.
4. Installation:
Installing BringBak.wpm requires no more than copying the
latter file plus SetNV.wpm and ParseNV.wpm to the directory where
your WordPerfect macros are located, and copying AutoBak.exe and
USendBak.exe to the same or equally accessible directory. The
BringBak system operates completely on your computer's memory
rather than on other files, so the location of the .exe file is
not critical.
5. Operation:
A. The BringBak.wpm macro performs important but much less
difficult tasks than AutoBak.exe and USendBak.exe.
Specifically, it sets aside an area of memory to receive
the outside information and it truncates the information
received in that area to minimum size and assigns it to the
variable NewVar. You may, therefore, execute the BringBak
macro directly or you may have another macro chain or nest to
it, presumably with the idea of acting upon the
information returned in NewVar.
B. Executing the BringBak macro puts you in a DOS shell. At
that point you (or a batch file) will execute some
outside process and produce a result or file name or some
code that is to be sent back to WordPerfect. This
information must be kept to 120 characters or less.
C. The importation of the information back into WordPerfect is
accomplished by either of two .exe programs: AutoBak.exe or
USendBak.exe. The only difference between these programs is
whether or not they automatically issue an EXIT command upon
their termination. AutoBak.exe issues an EXIT, causing an
immediate attempt to return to WordPerfect from a DOS shell
upon the program's termination. USendBak.exe does NOT issue
an EXIT command upon termination. Return to DOS from a SHELL
must, therefore, be explicitly directed by the user or by a
batch file from which the USendBak program was executed.
Use AutoBak.exe when you've invoked a DOS shell from
WordPerfect, not just issued a DOS command. Save it as the
last command to be executed in the SHELL and use it to return
to WordPerfect. Use USendBak.exe when you've invoked a single
DOS command to execute a batch file and you want to control
when the batch file returns control to WordPerfect.
D. Data is returned to WordPerfect via either .exe program in one
of two ways:
1) It is typed in by the user directly on the command line.
(e.g., AUTOBAK This is the data I want to bring back.)
2) A file name, preceded by an @ sign, is entered on the
command line to designate the file holding the data
to be imported. (e.g., USENDBAK @d:\stats\means)
Either of the above ways of specifying the data to be returned
may be entered on the .exe program's command line in any of
the following ways:
1) manually typed in by the user
2) written to the line in a batch file following the commands
for the external processes that are generating the data
to be brought back.
3) in the case of an @filename, the filename may always
be the same or it may be passed as an argument in the
DOS command issued from WordPerfect.
E. The SetNV.wpm and ParseNV.wpm macros allow you to set up an
importation variable from within another macro, bring back up
to 120 bytes of data and put it in NewVar, and use the data
in NewVar for any purposes that the parent macro may require.
One big difference from simply {NEST}ing to BringBak.wpm is
that SetNV sets up the importation variable without proceeding
immediately with a SHELL to DOS. Thus, the type of SHELL and,
if it is a single DOS command execution, the specific command
and the arguments it contains is completely under user control.
The other difference is that, upon return from the external
process, no messages or prompts are issued, and the actions
taken, even in the case of failure to obtain the data sought,
are completely under user control.
The most common use of these macros will likely be
their invocation at desired points in other macros via {NEST}
commands. All that is required to invoke these macros is the
issuance of the following commands at the desired points within
a macro:
{NEST}SetNV~
{NEST}ParseNV~
It should be noted that ParseNV.wpm contains a commented
section which indicates that commands may be specifically entered
in that section to govern the action to be taken in the event
that no data is returned. Also, although these macros weren't
specifically used, most of their content was used in the portion
of the EditWP.wpm macro that controls the SHELL to the external
macro compilation program. This is a good example of the utility
of these macros.
6. Technical support:
Free technical support will be furnished to any licensed user
who calls on weekdays during the hours from 9:00 a.m. to 5:00 p.m.
(Eastern) at the following number: (919) 643-3492
We may also be reached by mail at:
Performance Sciences International
Suite 1250
3001 Latta Drive
Summerfield, NC 27358