From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,fdd666e41beaa02 X-Google-Attributes: gid1164f8,public From: vandenheuvel@eps.enet.dec.com (Hein RMS van den Heuvel) Subject: Re: VAX Basic Help Date: 1995/06/15 Message-ID: <3rq59s$ffd@jac.zko.dec.com>#1/1 X-Deja-AN: 104450982 references: <1995Jun12.215102.3083@mec.ohio.gov> <1995Jun12.215309.3086@mec.ohio.gov> organization: Digital Equipment Corporation newsgroups: comp.sys.dec 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... $loop_to_menu = 1 $loop: $RUN MENU $IF loop_to_menu THEN goto loop ! Set to false by menu when done $ 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." +--------------------------------------+