home *** CD-ROM | disk | FTP | other *** search
- * HOTSPOT - Relay/PC for Windows "HOTSPOT" processor.
- * (c) Copyright 1991,93 Relay Technology Inc.
- *
- * INVOCATION:
- * This script is executed whenever the user right-clicks on the terminal
- * screen.
- *
- * FUNCTION:
- * This script has three functions. They are Hotspot "words", Hotspot
- * "blocks", and "lightpen". A description follows:
- *
- * Hotspot "Words"
- * A user could be clicking on a "word", that is anything with a space on
- * either side of it. The default is to assume that if we are a 3270
- * terminal and the "word" is a number from 1-24, then send a PF1-PF24.
- * In all other cases, simply send the "word".
- *
- * Hotspot "Blocks"
- * The user could have "marked" a block on the terminal screen by pressing
- * the left mouse button and holding it down and moving the mouse pointer
- * to highlight their block.
- *
- * Light Pen
- * Pointing at an area of the 3270 screen with the mouse pointer, and then
- * double clicking the right mouse button will cause the the 3270 cursor to
- * be repositioned to that point, and a 3270 "Cursor Select" function to
- * be automatically executed. This feature is only available if a global
- * variable &$LITEPEN is set to "ON". This can be done in the RELAY.OFP
- * (RELAY Gold Offline Profile). Issue the commands:
- * GLOBAL &$LITEPEN
- * &$LITEPEN=ON
- *
- * PASSED ARGUMENTS:
- * If no block is marked: If a block is marked:
- * &1 = row number &1 = row number of upper left corner
- * &2 = column number &2 = column number of upper left corner
- * &3 = 0 &3 = row number of lower right corner
- * &4 = 0 &4 = column number of lower right corner
-
- *
- * If we are a 3270 terminal, and the user variable "&$LITEPEN" is set to ON,
- * then simulate the use of a lightpen with the current position of the mouse
- * pointer.
- *
- *---------------------------------------------------------------------*
- * Module History *
- *---------------------------------------------------------------------*
- * *
- * Latest Revision - *
- * *
- * $Revision: 1.8 $ *
- * *
- * Modification Log - *
- * *
- * F0106V70 Fix HOTSPOT script litepen check for ON value *
- * by JMM on 03/08/96 *
- * M0001V70 Put Relay Source Files under PVCS Control *
- * by JMM on 12/18/95 *
- * *
- *---------------------------------------------------------------------*
-
- -LITEPEN if (&where = 3270) and (&$LITEPEN ~ "ON")
- then cursor &1 &2
- then key cursel
- * then key enter
- then quiet stop
-
- *
- * Check to see if this is a "block" operation...
- *
- if (&3 <> 0) goto -BLOCK
-
- *
- * This is not a "block" operation, so find out what the "word" is that has been
- * "clicked" on...
- *
- -WORD &ROW = &SIMAGE(&1, 1, &SWIDTH)
-
- &SLEFT = &LEFT(&ROW, &2)
- &TMP = &REVERSED(&SLEFT) !
- &LSPACE = &INSTR(&TMP, )
- &STARTC = &2 + 2 - &LSPACE
-
- &SRIGHT = &SUBSTRING(&ROW, &2) !
- &RSPACE = &INSTR(&SRIGHT, )
- &ENDC = &2 + &RSPACE - 1
-
- if (&ENDC > &STARTC)
- then &WORDLEN = &ENDC - &STARTC
- then &WORD = &SUBSTRING(&ROW, &STARTC, &WORDLEN)
- else &WORD =
-
- *
- * We now have exactly what the user "clicked" on. Before we strip out the non
- * aplha and numerics, see if they had clicked on any special word verbs...
- *
- -SPECVERB if (&WORD ~ "MORE...") then key pa2 ; quiet stop
- if (&WORD ~ "***") then key enter ; quiet stop
-
- *
- * Check for validity now. We only want to process numbers and/or letters.
- * Throw away any leading non-valid characters. This gives you the beginning of
- * the "word". Then look for the next non-valid character or the last character
- * in the string. This gives the end of the "word". Now you are ready to go...
- * For example:
- * "[[[word]]]" yields "word" "[10.]" yields "10"
- * "word]]]" yields "word" "wor.d]]]" yields "wor"
- *
- &VALID = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
- &FINLWORD = "" ; &GOOD = N ; &WORDPOS = 1
- &WORDLEN = &len(&WORD)
- loop -OUT &WORDLEN
- &LETTER = &substring(&WORD,&WORDPOS,1)
- if (&instring(&VALID,&LETTER) <> 0)
- then &FINLWORD = &FINLWORD.&LETTER
- then &WORDPOS = &WORDPOS + 1
- then &GOOD = Y
- then goto -OUT
- if (&GOOD = Y) then &WORD = &FINLWORD ; goto -WORDVERB
- &WORDPOS = &WORDPOS + 1
- -OUT
-
- *
- * We now have exactly the word that the user clicked on, with any non-alpha
- * or non-numerics removed. Do we want to take action on any of these...
- *
- -WORDVERB if (&WORD ~ "HOLDING") then key enter ; key pa2 ; quiet stop
-
- *
- * Users may add additional "verbs" for application specific HOTSPOTs.
- * The additional verbs should follow this line...
- *
-
- *
- * OK, it is not a special verb, so lets take the next appropriate action.
- * If this is NOT a 3270 terminal, then simply send the "word" to the other
- * computer and exit.
- * As of 12/28/93, we also handle protocol converter PF Key simulation
-
- -WORDTTY if (&where = 3270) or (&where = TTY)
- then Goto -WORD3270
- else Goto -SENDWORD
-
- *
- * Well, we are a 3270 terminal. If the "word" contains a 1-24, assume that the
- * user wants to issue a PF1-PF24. If the "word" does not contain a 1-24, then
- * simply send the "word" to the host computer.
- *
- -WORD3270 &WORD = &trim(&WORD)
- &KEYCTR = 24
- loop *+2 24
- if (&instring(&WORD,&KEYCTR) <> 0) then Goto -SENDPF
- &KEYCTR = &KEYCTR - 1
- Goto -SENDWORD
- -SENDPF
- If (&where = 3270)
- then key PF&KEYCTR
- then quiet stop
-
- *
- * if we are not sending PF keys we send the number instead.
- *
- if (&option(hotspot.pfkeys)) <> ON)
- then send "&KEYCTR"
- then quiet stop
-
- * For Protocol Converters, we have to get the definition out of the
- * keyfile - this routine assumes the standard Relay definitions
- If (&KEYCTR < 11)
- then SUBSTITUTE &OPTION(KEY F&KEYCTR)
- then quiet stop
- If (&KEYCTR < 21)
- then &KEYCTR = &KEYCTR - 10
- then SUBSTITUTE &OPTION(KEY CS-F&KEYCTR)
- then quiet stop
- * must be 21 thru 24
- &KEYCTR = &KEYCTR - 20
- SUBSTITUTE &OPTION(KEY S-F&KEYCTR)
- quiet stop
- *
- * We could not find a 1-24, so just send the "word"...
- *
- -SENDWORD
- send "&WORD"
- quiet stop
-
- *
- * The user has indicated some action against a "marked block". Process the
- * "block" one line at a time, sending each line to the host as it appears.
- *
- -BLOCK &MLENGTH = &calc(&4 - &2 + 1)
- &CNT = &1
- loop -BUILD while (&CNT <= &3)
- &MARK = &simage(&CNT,&2,&MLENGTH)
- send "&MARK"
- -BUILD &CNT = &CNT + 1
- quiet stop
-