From: vandenheuvel@eps.enet.dec.com (Hein RMS van den Heuvel)
Subject: Re: VAX Basic Help
Date: 1995/06/15 [thread overview]
Message-ID: <3rq59s$ffd@jac.zko.dec.com> (raw)
In-Reply-To: 1995Jun12.215309.3086@mec.ohio.gov
In article <1995Jun12.215309.3086@mec.ohio.gov>, duncan@mec.ohio.gov writes...
>Here is a question for someone who has programed in VAX BASIC before. Is there
>anyway to execute DCL commands from inside of a basic program? What I want
>to do is to create a menu in basic and have users execute DCL commands.
The easiest method is to call LIB$SPAWN. This can easily be done
from any VMS programming language, including BASIC.
It is a little expensive in that it creates a second process to do
the work and the main process is still sitting there 'hogging'
memory untill the sub process is done.
To use a single process, check out LIB$DO_COMMAND, but this reliquishes
control to the next image, stopping the menu image. That next image then
has the responability to chain back to the menu driver. Which then has
to re-open its files and so on, not 'cheap' either.
VAX BASIC makes LIB$DO_COMMAND easy through the CHAIN command.
You might want to enure going back to the menu for unexpected
menu endings by running the menu in a loop from a little command file.
$ON ERROR... <fill in>
$loop_to_menu = 1
$loop:
$RUN MENU
$IF loop_to_menu THEN goto loop ! Set to false by menu when done
$<fill in clean up action>
If excursions from menu to target programs become relatively frequent
(more then once every 10 seconds?) then you may want to keep the spawned
subprocess alive and feed it new commands through a mail box, or more
closely integrate target programs and menu (calling routines in (shareable)
libraries, or relocating some menu actions to the programs.
For real serious implementations, expecting many (hundreds) of users selecting
from dozens of tasks you may want to examine heavy duty solutions such
as Digital's ALL-IN-1 or ACMS or somesuch.
$BASIC
Help chain
CHAIN
The CHAIN statement transfers control from the current program to another
VAX BASIC program. The program to recieve control must be in executable
format.
Hope this helps, +--------------------------------------+
Hein van den Heuvel, Digital. | All opinions expressed are mine, and |
"Makers of VMS and other | may not reflect those of my employer |
fine Operating Systems." +--------------------------------------+
prev parent reply other threads:[~1995-06-15 4:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1995Jun12.215102.3083@mec.ohio.gov>
1995-06-12 4:00 ` VAX Basic Help duncan
1995-06-14 4:00 ` Steve Lionel
1995-06-15 4:00 ` Hein RMS van den Heuvel [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox