This post describes how LBTUTOR processes a non-select (no menu) tutorial under ISPF v2.2 (ISPF-like product from Wally Mclaughlin) with the LBTUTOR add-on.
Sample Tutorial without Selection Topics
A simple form of a tutorial can be comprised of a single panel or a series of panels displayed in sequence to convey online information to the end user.
For example, the LBTUTOR tutorial exemplifies this behavior by using three panels linked together to describe the LBTUTOR function and commands as depicted in the below flowchart:
ZHINDEX=TLB2TR00 +----------+ ZHTOP=TLB2TR00 LBTUTOR Tutorial ----> | TLB2TR00 |<---------+ ZCONT=TLB2TR01 +----------+ | | | v ^ +----------+ | | TLB2TR01 | | ZCONT=TLB2TR02 +----------+ | | | v ^ +----------+ | | TLB2TR02 | | ZCONT=TLB2TR03 +----------+ | | | v ^ +----------+ | | TLB2TR03 | | ZCONT=TLB2TR00 +----------+ | | | +---->---+ Sequential viewing of information (topic) continues by pressing ENTER key.
When the tutorial is started via
TSO LBTUTOR, or
TSO LBTUTOR TLB2TR00, panel TLB2TR00 displays.
When ENTER is pressed, panel TLB2TR01 displays.
When ENTER is pressed, panel TLB2TR02 displays.
When ENTER is pressed, panel TLB2TR03 displays.
When ENTER is pressed, panel TLB2TR00 displays, restarting the tutorial, until PF3 is depressed to return to previous ISPF application (function).
The top level of the tutorial is declared by setting the system variables &ZHTOP and &ZHINDEX to TLB2TR00 allowing the end user to conveniently issue the TOP or INDEX navigation command to quickly return to the beginning of the tutorial or topic. Typically, this declaration occurs in the first application panel to get control, in this case, TLB2TR00. See following panel definition snippet of TLB2TR00:
. . . )INIT &ZHTOP = TLB2TR00 /* Application TOP level panel */ &ZHINDEX = TLB2TR00 /* Application INDEX panel */ )PROC &ZCONT = TLB2TR01 /* Next panel for navigation */ )END .
Each ‘next’ panel in the tutorial sequence is declared by setting the system variable &ZCONT in each panels PROC section as shown in the below panel definition snippet for TLB2TR01:
. . . )INIT )PROC &ZCONT = TLB2TR02 /* Next panel for navigation */ )END .
How LBTUTOR handles a non-select tutorial
Using the above sample tutorial, initiate a tutorial session with following ISPF command:
TSO LBTUTOR TLB2TR00
Pseudo logic-flow for LBTUTOR from top to bottom:
o IF ISPF active - THEN, continue. - ELSE, error 'ISPF not active', terminate LBTUTOR. o Initialize back-stack and up-stack. o IF panel name passed in command line - THEN, tutorial panel = panel name passed. - ELSE, tutorial panel = TLB2TR0 (LBTUTOR Tutorial). o Initialize internal variables ZCONT, ZIND, ZSEL to blanks. o IF panel name valid - THEN, continue. - ELSE, error 'invalid panel name', attempt to display error on current panel or terminate LBTUTOR. DISPLAY_PANEL: o ISPF DISPLAY service processes )ATTR, )BODY, )INIT sections and displays panel name awaiting user interrupt (input). o User presses ENTER, ISPF DISPLAY service processes )PROC section logic. o ZCMD value transformed to upper-case. o IF ZIND = YES, ZINDEX = panel name. o PUSH panel name to back-stack. o IF ZCONT > blanks, panel name = ZCONT, goto DISPLAY_PANEL. o IF Up-stack-counter > 0, panel name = up-stack POP, goto DISPLAY_PANEL. o IF ZUP > blanks, panel name = ZUP, goto DISPLAY_PANEL. o IF ZHTOP > blanks, panel name = ZHTOP, goto DISPLAY_PANEL. o Error 'cannot sequence navigate', goto DISPLAY_PANEL (redisplay).