RE: Dynamically set VMS "environment" settings from a program? - VMS

This is a discussion on RE: Dynamically set VMS "environment" settings from a program? - VMS ; > -----Original Message----- > From: ian.s.burgess@gmail.com [mailto:ian.s.burgess@gmail.com] > Sent: Tuesday, July 24, 2007 9:41 PM > To: Info-VAX@Mvb.Saic.Com > Subject: Re: Dynamically set VMS "environment" settings from a program? > > On Jul 25, 12:12 pm, "Paul Raulerson" wrote: > ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: RE: Dynamically set VMS "environment" settings from a program?

  1. RE: Dynamically set VMS "environment" settings from a program?



    > -----Original Message-----
    > From: ian.s.burgess@gmail.com [mailto:ian.s.burgess@gmail.com]
    > Sent: Tuesday, July 24, 2007 9:41 PM
    > To: Info-VAX@Mvb.Saic.Com
    > Subject: Re: Dynamically set VMS "environment" settings from a program?
    >
    > On Jul 25, 12:12 pm, "Paul Raulerson" wrote:
    > > Ah HAH! I have at last figured out something that will be elementary

    > to you
    > > folks, but has annoyed the living daylights out of me for a week now.

    >
    > >
    > > Take a typical (green screen) program, it puts up a header at the top

    > of the
    > > screen, body text, a function key line and a message line at the

    > bottom.
    > > Okay, this is more IBM that perhaps VMS green screen programs are

    > normally
    > > setup to be, but hey- I have not SEEN any VMS green screen programs

    > other
    > > than the editors, and *they* can use function keys!
    > >
    > > I even figured out how to get into "USER-MODE" and stay there, but

    > for the
    > > life of me, function keys insist on doing weird and strange things -

    > like
    > > causing an interrupt when I hit F6 for example.
    > >
    > > But I finally found the magic incantation that takes care of *that*
    > > problem... one need only perform a set term/NOLINE_EDITING and voila!

    > The
    > > doggone function keys work as expected. (From Putty, with VT400 keys

    > set,
    > > and using /DEVICE_TYPE=VT400_SERIES in the set term command...)
    > >
    > > Problem is, it actually does turn off terminal editing, and I *LIKE*
    > > terminal editing! So I would like to dynamically turn this feature

    > OFF when
    > > a program starts, and then turn it back ON when the program exits.
    > >
    > > How might I go about doing this? In particular from COBOL?
    > >
    > > Thanks
    > > -Paul
    > >
    > > P.S. It is okay to refer me to the correct manual; I have searched

    > all
    > > through the COBOL manuals and I suspect I did not recognize what I am
    > > looking for. -Paul

    >
    > Paul,
    >
    > Calling LIB$DO_COMMAND from Cobol seems like an easy option.
    >
    > Ian



    Ah Ian - you are a genius. DO_COMMAND does the job, but it terminates the
    cotton picking executable that calls it.
    However, LIB$SPAWN works just great to do the same thing, with the advantage
    I don't have to clean up on the way out - the setting appears to be held
    only through execution of the main program.

    Thanks
    -Paul

    In the most simple form, the call is:
    77 WS-USER-COMMAND PIC X(127) VALUE SPACES.
    ...
    ...
    ...
    CALL "LIB$SPAWN"
    USING BY DESCRIPTOR WS-USER-COMMAND



  2. Re: Dynamically set VMS "environment" settings from a program?

    Hi Paul,

    This from page 193: -

    TT2$M_EDIT Terminal edit. This characteristic is set by the SET TERMINAL
    command for all terminals that support ANSI-defined advanced
    editing functions. These functions include the ability to insert or
    delete a line and the ability to insert or delete characters in an
    existing line. Terminals with this characteristic are a superset of
    TT2$M_DECCRT. Appendix Clists the valid escape sequences for
    terminals with the TT2$M_EDIT characteristic.

    You $assign a channel to the terminal then call $qio io$_setmode to toggle
    it and then $dassgn before exit to be neat.

    I can't swear that the above works (and I'd do it for you if I wasn't trying
    to prove a buffer overrun stack-corrupter with Multinet's io$_acpcontrol
    inetacp$c_trans inetacp_func$c_gethostbyaddr ) but it sounds about right.

    > Ah Ian - you are a genius. DO_COMMAND does the job, but it terminates the


    > CALL "LIB$SPAWN"
    > USING BY DESCRIPTOR WS-USER-COMMAND


    If you're happy with that then great, but mate it's not the Sufi way! (Well
    not the VMS way anyway :-)

    Cheers Richard Maher

    PS: Was it AOS/VS that used to spawn a process to do everything?

    "Paul Raulerson" wrote in message
    news:004501c7ce6d$5a469240$0ed3b6c0$@com...
    >
    >
    > > -----Original Message-----
    > > From: ian.s.burgess@gmail.com [mailto:ian.s.burgess@gmail.com]
    > > Sent: Tuesday, July 24, 2007 9:41 PM
    > > To: Info-VAX@Mvb.Saic.Com
    > > Subject: Re: Dynamically set VMS "environment" settings from a program?
    > >
    > > On Jul 25, 12:12 pm, "Paul Raulerson" wrote:
    > > > Ah HAH! I have at last figured out something that will be elementary

    > > to you
    > > > folks, but has annoyed the living daylights out of me for a week now.

    > >
    > > >
    > > > Take a typical (green screen) program, it puts up a header at the top

    > > of the
    > > > screen, body text, a function key line and a message line at the

    > > bottom.
    > > > Okay, this is more IBM that perhaps VMS green screen programs are

    > > normally
    > > > setup to be, but hey- I have not SEEN any VMS green screen programs

    > > other
    > > > than the editors, and *they* can use function keys!
    > > >
    > > > I even figured out how to get into "USER-MODE" and stay there, but

    > > for the
    > > > life of me, function keys insist on doing weird and strange things -

    > > like
    > > > causing an interrupt when I hit F6 for example.
    > > >
    > > > But I finally found the magic incantation that takes care of *that*
    > > > problem... one need only perform a set term/NOLINE_EDITING and voila!

    > > The
    > > > doggone function keys work as expected. (From Putty, with VT400 keys

    > > set,
    > > > and using /DEVICE_TYPE=VT400_SERIES in the set term command...)
    > > >
    > > > Problem is, it actually does turn off terminal editing, and I *LIKE*
    > > > terminal editing! So I would like to dynamically turn this feature

    > > OFF when
    > > > a program starts, and then turn it back ON when the program exits.
    > > >
    > > > How might I go about doing this? In particular from COBOL?
    > > >
    > > > Thanks
    > > > -Paul
    > > >
    > > > P.S. It is okay to refer me to the correct manual; I have searched

    > > all
    > > > through the COBOL manuals and I suspect I did not recognize what I am
    > > > looking for. -Paul

    > >
    > > Paul,
    > >
    > > Calling LIB$DO_COMMAND from Cobol seems like an easy option.
    > >
    > > Ian

    >
    >
    > Ah Ian - you are a genius. DO_COMMAND does the job, but it terminates the
    > cotton picking executable that calls it.
    > However, LIB$SPAWN works just great to do the same thing, with the

    advantage
    > I don't have to clean up on the way out - the setting appears to be held
    > only through execution of the main program.
    >
    > Thanks
    > -Paul
    >
    > In the most simple form, the call is:
    > 77 WS-USER-COMMAND PIC X(127) VALUE SPACES.
    > ..
    > ..
    > ..
    > CALL "LIB$SPAWN"
    > USING BY DESCRIPTOR WS-USER-COMMAND
    >
    >




  3. Examples: : Dynamically set VMS "environment" settings from a program?

    If you go to our home page click on examples and search for QIO you will
    find a number
    of examples.

    On Tue, 24 Jul 2007 21:01:12 -0700, Richard Maher
    wrote:

    > Hi Paul,
    >
    > This from page 193: -
    >
    > TT2$M_EDIT Terminal edit. This characteristic is set by the SET TERMINAL
    > command for all terminals that support ANSI-defined advanced
    > editing functions. These functions include the ability to insert or
    > delete a line and the ability to insert or delete characters in an
    > existing line. Terminals with this characteristic are a superset of
    > TT2$M_DECCRT. Appendix Clists the valid escape sequences for
    > terminals with the TT2$M_EDIT characteristic.
    >
    > You $assign a channel to the terminal then call $qio io$_setmode to
    > toggle
    > it and then $dassgn before exit to be neat.
    >
    > I can't swear that the above works (and I'd do it for you if I wasn't
    > trying
    > to prove a buffer overrun stack-corrupter with Multinet's io$_acpcontrol
    > inetacp$c_trans inetacp_func$c_gethostbyaddr ) but it sounds about right.
    >
    >> Ah Ian - you are a genius. DO_COMMAND does the job, but it terminates
    >> the

    >
    >> CALL "LIB$SPAWN"
    >> USING BY DESCRIPTOR WS-USER-COMMAND

    >
    > If you're happy with that then great, but mate it's not the Sufi way!
    > (Well
    > not the VMS way anyway :-)
    >
    > Cheers Richard Maher
    >
    > PS: Was it AOS/VS that used to spawn a process to do everything?
    >
    > "Paul Raulerson" wrote in message
    > news:004501c7ce6d$5a469240$0ed3b6c0$@com...
    >>
    >>
    >> > -----Original Message-----
    >> > From: ian.s.burgess@gmail.com [mailto:ian.s.burgess@gmail.com]
    >> > Sent: Tuesday, July 24, 2007 9:41 PM
    >> > To: Info-VAX@Mvb.Saic.Com
    >> > Subject: Re: Dynamically set VMS "environment" settings from a

    >> program?
    >> >
    >> > On Jul 25, 12:12 pm, "Paul Raulerson" wrote:
    >> > > Ah HAH! I have at last figured out something that will be elementary
    >> > to you
    >> > > folks, but has annoyed the living daylights out of me for a week

    >> now.
    >> >
    >> > >
    >> > > Take a typical (green screen) program, it puts up a header at the

    >> top
    >> > of the
    >> > > screen, body text, a function key line and a message line at the
    >> > bottom.
    >> > > Okay, this is more IBM that perhaps VMS green screen programs are
    >> > normally
    >> > > setup to be, but hey- I have not SEEN any VMS green screen programs
    >> > other
    >> > > than the editors, and *they* can use function keys!
    >> > >
    >> > > I even figured out how to get into "USER-MODE" and stay there, but
    >> > for the
    >> > > life of me, function keys insist on doing weird and strange things -
    >> > like
    >> > > causing an interrupt when I hit F6 for example.
    >> > >
    >> > > But I finally found the magic incantation that takes care of *that*
    >> > > problem... one need only perform a set term/NOLINE_EDITING and

    >> voila!
    >> > The
    >> > > doggone function keys work as expected. (From Putty, with VT400 keys
    >> > set,
    >> > > and using /DEVICE_TYPE=VT400_SERIES in the set term command...)
    >> > >
    >> > > Problem is, it actually does turn off terminal editing, and I *LIKE*
    >> > > terminal editing! So I would like to dynamically turn this feature
    >> > OFF when
    >> > > a program starts, and then turn it back ON when the program exits..
    >> > >
    >> > > How might I go about doing this? In particular from COBOL?
    >> > >
    >> > > Thanks
    >> > > -Paul
    >> > >
    >> > > P.S. It is okay to refer me to the correct manual; I have searched
    >> > all
    >> > > through the COBOL manuals and I suspect I did not recognize what I

    >> am
    >> > > looking for. -Paul
    >> >
    >> > Paul,
    >> >
    >> > Calling LIB$DO_COMMAND from Cobol seems like an easy option.
    >> >
    >> > Ian

    >>
    >>
    >> Ah Ian - you are a genius. DO_COMMAND does the job, but it terminates
    >> the
    >> cotton picking executable that calls it.
    >> However, LIB$SPAWN works just great to do the same thing, with the

    > advantage
    >> I don't have to clean up on the way out - the setting appears to be held
    >> only through execution of the main program.
    >>
    >> Thanks
    >> -Paul
    >>
    >> In the most simple form, the call is:
    >> 77 WS-USER-COMMAND PIC X(127) VALUE SPACES.
    >> ..
    >> ..
    >> ..
    >> CALL "LIB$SPAWN"
    >> USING BY DESCRIPTOR WS-USER-COMMAND
    >>
    >>

    >
    >




    --
    PL/I for OpenVMS
    www.kednos.com

  4. Re: Dynamically set VMS "environment" settings from a program?

    "Richard Maher" writes:

    >Hi Paul,


    >This from page 193: -


    >TT2$M_EDIT Terminal edit. This characteristic is set by the SET TERMINAL
    >command for all terminals that support ANSI-defined advanced
    >editing functions.



    >You $assign a channel to the terminal then call $qio io$_setmode to toggle
    >it and then $dassgn before exit to be neat.


    >I can't swear that the above works (and I'd do it for you if I wasn't trying
    >to prove a buffer overrun stack-corrupter with Multinet's io$_acpcontrol
    >inetacp$c_trans inetacp_func$c_gethostbyaddr ) but it sounds about right.


    Typically, you'd assign a channel, do a $QIO SENSEMODE to get the
    existing characteristics, copy the characteristics to another buffer
    while setting/clearing the desired bits (TT2$M_EDIT), do a $SETMODE of
    the new characteristics. Upon exit, do a $SETMODE of the first buffer
    to reset the original characteristics then deassign the channel. I've
    done this many times.


+ Reply to Thread