Jump to page titleUNITED STATES
hp.com home products and services support and drivers solutions how to buy
» contact hp

:

more options
 

hp.com home
End of Jump to page title
Example-PLI How To Change Terminal Characteristics With $QIO/SETMODE
Jump to content



» 

business support center

Home & Home Office Support:
» HP branded products
» Presario branded products
» Services & Warranties
Small & Medium Business Support:
» Small & Medium Business products
» Small & Medium Business services
Support for IT Professionals:
» Enterprise products (IT Resource Center)
» NonStop enterprise products
» Business & IT Services
Content starts here
Copyright (c) Digital Equipment Corporation 1991. All rights reserved
LAYERED PRODUCT:  VAX PLI V3.3          OP/SYS: VMS, 5.3-1

SOURCE:     Digital Customer Support Center


OVERVIEW:

This program performs a QIO with SENSEMODE function to determine the
current terminal characteristics.  It then does a QIO with SETMODE
function to set toggle the Lower Case characteristic.  See the IO
User's Guide in the terminal driver section for more information on
the sensemode/setmode qio.


*** CAUTION ***

This sample program has been tested using VAX PLI Version 3.3 on VMS
5.3-1.  However, we cannot guarantee its effectiveness because of the
possibility of error in transmitting or implementing it.  It is meant
to be used as a template for writing your own program and it may
require modification for use on your system.


PROGRAM:

qioterm: proc options(main);

%include SYS$QIO;
%include $iodef;
%include $ttdef;
%include SYS$assign;
%include sys$dassgn;
%include $STSDEF;
%include $SSDEF;
dcl term char(10) init('sys$output');
dcl termch fixed bin(15);
dcl iosb(4) fixed bin(15);

dcl 1 P1,
      2 term_class fixed bin(7),
      2 term_type fixed bin(7),
      2 term_size fixed bin(15),
      2 terminal_chars union,
         3 term_char fixed bin(22),
         3 term_char_bit bit(23),
      2 term_page fixed bin(7),
      2 term_extend fixed bin(31);

dcl lower bit(1) init('0'b);

dcl indata char(1);

/* assign a channel to the terminal */
sts$value = SYS$ASSIGN(term,termch,,);

IF ^sts$success
    then signal vaxcondition(sts$value);

/*retrieve the terminal's current characteristics*/
sts$value = sys$QIOW(,termch,IO$_SENSEMODE,IOSB,,,ref(p1),value(12),,,,);

IF ^sts$success
    then signal vaxcondition(sts$value);
if IOSB(1) ^=ss$_normal
    then signal vaxcondition(iosb(1));
/*see if the terminal is set to lower or not, in bit 8*/

lower= substr(term_char_bit,8,1);

/*determine if changes need to be made*/
if lower
    then do;
       put skip list
       ('The current case is lower, Do you which to change to upper case? ');
       get list (indata);
       if indata = 'Y' | indata = 'y'
           then substr(term_char_bit,8,1) = '0'b;
    end;
    else do;
           put skip list
       ('The current case is upper, Do you which to change to lower case? ');
       get list (indata);
       if indata = 'Y' | indata = 'y'
           then term_char_bit = term_char_bit | tt$m_lower;
    end;
if indata = 'Y' | indata = 'y'
   then;
   else goto done;

/* update the terminal's characteristics*/
sts$value = sys$QIOW(,termch,IO$_SETMODE,IOSB,,,ref(p1),value(12),,,,);

IF ^sts$success
    then signal vaxcondition(sts$value);
if IOSB(1) ^=ss$_normal
    then signal vaxcondition(iosb(1));

sts$value = sys$dassgn(termch);
IF ^sts$success
    then signal vaxcondition(sts$value);


put skip list ('Enter some data - the case should be set');
Get list (indata);
put skip list ('The data that you entered was: ',indata);
done:
put skip list ('Finished processing ');

end qioterm;




buy online or call 1.800.AT.COMPAQ
privacy statementusing this site means you accept its terms