Operating System - OpenVMS
1827721 Members
2738 Online
109968 Solutions
New Discussion

Re: How do I launch a DECterm that opens a TXT file from a COM file?

 
SOLVED
Go to solution
Kenneth Toler
Frequent Advisor

How do I launch a DECterm that opens a TXT file from a COM file?

I have one com file that brings up a menu for a tool.

I am adding a help function to the menu.

How do I when I select the "HELP" menu item launch a new DECterm that will open a TXT file.

This TXT file will be perused while the tool is in use.

Finally, Is there a way to close this newly launched DECterm other than "lo" or "File-->Exit"?
12 REPLIES 12
Wim Van den Wyngaert
Honored Contributor
Solution

Re: How do I launch a DECterm that opens a TXT file from a COM file?

create/term has a parameter.

e.g. create/term edit myhelp.txt

If you type control-z the window is deleted.

Wim
Wim
Kenneth Toler
Frequent Advisor

Re: How do I launch a DECterm that opens a TXT file from a COM file?

Ok,

How do I launch a DECterm that opens a README.TXT help file from a FORTRAN file?
Kenneth Toler
Frequent Advisor

Re: How do I launch a DECterm that opens a TXT file from a COM file?

Now how do I launch a DECterm that opens a README.TXT help file from a FORTRAN file? The new DECterm needs to be indepndent from the main menu that launched the new DECTERM.
Jan van den Ende
Honored Contributor

Re: How do I launch a DECterm that opens a TXT file from a COM file?

Kenneth,


Now how do I launch a DECterm that opens a README.TXT help file from a FORTRAN file?


You can always call LIB$SPAWN("create/term edit myhelp.txt") with NOWAIT

The FORTRAN details you probably know better than me.

hth

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Kenneth Toler
Frequent Advisor

Re: How do I launch a DECterm that opens a TXT file from a COM file?

If I wanted to make a subroutine out of the newly opened window,

1 how would I make it a standalone routine?
2 What include files would I need?

Thanks.
Kenneth Toler
Frequent Advisor

Re: How do I launch a DECterm that opens a TXT file from a COM file?

I have the DECterm now coming up, however, it stays up for only a split second. How do I make the DECterm stay up until the user is finished with it?

I am using LIB$SPAWN
Hein van den Heuvel
Honored Contributor

Re: How do I launch a DECterm that opens a TXT file from a COM file?

There is probably something wrong with sys$input. Tpu sees an EOF, it goes away, the terminal closes the spawn retuns.

I still think you should possibly check out DECwTermPort() as I replied in you other topic.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1050438


Anyway, I also found some old notes which suggest:

"You could probably fix this by synchronising in CMDFILE.COM with the CREATE/TERMINAL but that would be harder than the following.

In CMDFILE.COM

$ create/terminal/noprocess/define=xyz
$ assign/user xyz sys$input
$ assign/user xyz sys$output
$ edit/tpu/read the_files:file.txt

and then just LIB$SPAWN("@CMDFILE")

Untested!
Hein.


Hein van den Heuvel
Honored Contributor

Re: How do I launch a DECterm that opens a TXT file from a COM file?

Oh wait... maybe you just need to add /WAIT to the CREATE/TERM.

The default is NOWAIT. /WAIT Requires that you wait for the subprocess to terminate before you enter another DCL command. Your next DCL in the SPAWN is effectively a logout which kills that process as well as its children... the tpu process.

Check out $HELP CREATE /TERM ...

Hein.
Peter Barkas
Regular Advisor

Re: How do I launch a DECterm that opens a TXT file from a COM file?

Here's my effort:

lib$spawn("type/page readme.txt")

$ cre/term pipe sho time ; inq ans "Continue"
Kenneth Toler
Frequent Advisor

Re: How do I launch a DECterm that opens a TXT file from a COM file?

I now have the DECterm coming up when I type at the command prompt:

$ run/nodebug menu.exe

However, when I put this same run command into a COM file, the window opens, but the file is not displayed.

How could this be happening?
Hein van den Heuvel
Honored Contributor

Re: How do I launch a DECterm that opens a TXT file from a COM file?

You probably need to redefine SYS$INPUT and/or SYS$OUTPUT to point to SYS$COMMAND just before running the image in the .COM file. By default images run ina .COM file take their input from that .COM file.
Standard OpenVMS practice.

If that does nto solve it...

- Any error messages?
- Final stat (from ACCOUNTING?) for the sub process?
- SET WATCH FILE/CLA=MAJOR) ! Requires CMKRNL

Hein.

Kenneth Toler
Frequent Advisor

Re: How do I launch a DECterm that opens a TXT file from a COM file?

I did as you said by redefining SYS$OUTPUT to SYS$COMMAND just before RUN/NODEBUG MYFILE.EXE.

Now my README.TXT file is opening in the FORTRAN MAIN Window and not in the newly created DECTerm. Somehow, I need to redefine the opening of this file from the parent DECTerm to the child DECTerm. How can I accomplish this?