From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,cdc294a762a88ea3,start X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1995-03-28 20:43:14 PST Path: nntp.gmd.de!stern.fokus.gmd.de!ceres.fokus.gmd.de!zib-berlin.de!news.mathworks.com!news2.near.net!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!fdn.fr!uunet!in1.uu.net!auspex-gw.auspex.com!nntp-sc.barrnet.net!news.fujitsu.com!amdahl.com!pacbell.com!unet.net.com!mac_apps5.net.com!user From: bjorn_lindstrom@mac2.net.com,Heartagold@aol.com (Bjorn Lindstrom) Newsgroups: comp.sys.dec Subject: Trapping Control-Y/F6 in Basic Followup-To: comp.sys.dec Date: Tue, 28 Mar 1995 16:52:17 -0800 Organization: Lindstrom Industries Message-ID: Reply-To: Bjorn_Lindstrom@mac2.net.com NNTP-Posting-Host: mac_apps5.net.com I hope someone can point me in the right direction ... I am trying to prevent users from interrupting their current session, and am having trouble with the code found in Programming Volume 5C, on pages SMG-359 and SMG-360. There were some typos in the manual, which I have found, and fixed. My problem is that when I try to run this, and type a control-Y (or a F6), the program blows up with the message: Following is a sample of my code, which occurs after opening my files, and declaring my FMS screens. No screen has been displayed yet, BTW. ------------------ Begin Included Text --------------------- %INCLUDE "$SMGDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET" %INCLUDE "$SSDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET" %INCLUDE "LIB$ROUTINES" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET" ! (They conveniently left out the following lines the manual ... grrr EXTERNAL LONG FUNCTION SMG$CREATE_PASTEBOARD( LONG ) EXTERNAL LONG FUNCTION SMG$CREATE_VIRTUAL_KEYBOARD( LONG ) EXTERNAL LONG FUNCTION SMG$SET_OUT_OF_BAND_ASTS(LONG, LONG, LONG, LONG) ! The following code is almost verbatim from the manual ... DECLARE LONG STAT, PASTEBOARD_ID, KEYBOARD_ID, CONTROL_MASK CONTROL_MASK = (2 ** SMG$K_TRM_CTRLC) & + (2 ** SMG$K_TRM_CTRLY) STAT = SMG$CREATE_PASTEBOARD( PASTEBOARD_ID ) GOTO 32000 IF STAT <> SS$_NORMAL STAT = SMG$CREATE_VIRTUAL_KEYBOARD( KEYBOARD_ID ) GOTO 32000 IF STAT <> SS$_NORMAL STAT = SMG$SET_OUT_OF_BAND_ASTS( PASTEBOARD_ID, & CONTROL_MASK, & LOC( DISABLE_CTLC_CTLY ), & KEYBOARD_ID) GOTO 32000 IF STAT <> SS$_NORMAL ----------------------- End of Included Text ---------------------- Everything is working fine at this point. I display my (already loaded FMS screen, and prompt for user input, through a field. When I press Control-Y, nothing happens. So far, so good, thinks I. So, I enter a valid response to the field, and when I "accept" the value, *whammo*, I see the following messages: "Reserved operand fault at PC=0097A188, PSL=03C0000C" and ... "break on unhandled exception at SHARE$SMGSHR+103816" The subprogram it is calling is as follows (BTW, the SMG$ reference is incorrect in the manual): ------------------------- Begin Included Text -------------------- SUB DISABLE_CTLC_CTLY( SMG$R_OUT_OF_BAND_TABLE SMG_INFO, & LONG R0, LONG R1, LONG PC, LONG PSL ) %INCLUDE "$SMGDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET" %INCLUDE "$SSDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET" %INCLUDE "LIB$ROUTINES" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET" IF SMG_INFO::SMG$B_CHAR = SMG$K_TRM_CTRLY & OR SMG_INFO::SMG$B_CHAR = SMG$K_TRM_CTRLC THEN PRINT CHR$(7); !* BEEP TERMINAL ELSE !* IGNORE END IF SUBEND ------------------------- End of Included Text ----------------------- Should I be setting up for the ASTS *BEFORE* setting up FMS? If not, what am I doing wrong here? Thanks in advance for any and all help offered! Bjorn Lead Guitarist, YAF Band Proud owner of: '94 Custom Built B.C. Rich Mockingbird (Zebrawood/Graphite)