- ENJINJ3 ;(WASH ISC)/JA/TJK-Screen Input ;2.26.97
- ;;7.0;ENGINEERING**35**;;Aug 17, 1993
- ; Modified with **35** to handle escape sequences (ex: arrow keys)
- Z ;
- S DJSM=0,DJLG=+DJJ(V)+1
- D INITKB^XGF($C(9,13)) S X=$$READ^XGF("") S DJZ='$D(DTOUT) S:'DJZ X="^"
- I X="",$G(XGRT)]"" D
- . ; can only use jump navigation when data not entered in field
- . I "UP^LEFT"[XGRT D Q
- . . ; jump to previous field that is not read-only
- . . N I,J,K
- . . S I=V,K=0 F S I=$O(^ENG(6910.9,DJN,1,"A",I),-1) Q:I<1 D Q:K
- . . . S J=$O(^ENG(6910.9,DJN,1,"A",I,0))
- . . . I '$P($G(^ENG(6910.9,DJN,1,J,0)),U,7) S K=I
- . . S X="^"_$S(K:K,1:V)
- . I XGRT="PREV" S X="^U" Q
- . I XGRT="NEXT" S X="^D" Q
- S:X="" DJSM=1
- D RESETKB^XGF
- ;
- Z1 I $L(X)>(DJLG-1) W @IOBS," ",*7 X XY S:'$D(V(V)) V(V)="" D B:V(V)'="",D:V(V)="" W V(V) W:$D(DJDB) DJDB K DJDB X XY G Z
- I X?1"^".E!(X?1"?".E) S:'$D(V(V)) V(V)="" D B:V(V)'="",D:V(V)="" X XY W @DJHIN X XY W V(V) W:$D(DJDB) DJDB W @DJLIN K DJDB X XY Q
- Q
- N R !,"Repaint screen(Y/N): N//",DJX:DTIME I DJX["?" W !,*7,"Please enter 'Y'es or 'N'o." G N
- Q:"Yy"'[$E(DJX)!(DJX="") S DJSV=V D N^ENJDPL S V=DJSV Q
- B S $P(DJDB," ",DJJ(V)-$L(V(V)))="" Q
- D S $P(DJDB,".",DJJ(V))="." Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENJINJ3 1214 printed Mar 13, 2025@20:58:46 Page 2
- ENJINJ3 ;(WASH ISC)/JA/TJK-Screen Input ;2.26.97
- +1 ;;7.0;ENGINEERING**35**;;Aug 17, 1993
- +2 ; Modified with **35** to handle escape sequences (ex: arrow keys)
- Z ;
- +1 SET DJSM=0
- SET DJLG=+DJJ(V)+1
- +2 DO INITKB^XGF($CHAR(9,13))
- SET X=$$READ^XGF("")
- SET DJZ='$DATA(DTOUT)
- if 'DJZ
- SET X="^"
- +3 IF X=""
- IF $GET(XGRT)]""
- Begin DoDot:1
- +4 ; can only use jump navigation when data not entered in field
- +5 IF "UP^LEFT"[XGRT
- Begin DoDot:2
- +6 ; jump to previous field that is not read-only
- +7 NEW I,J,K
- +8 SET I=V
- SET K=0
- FOR
- SET I=$ORDER(^ENG(6910.9,DJN,1,"A",I),-1)
- if I<1
- QUIT
- Begin DoDot:3
- +9 SET J=$ORDER(^ENG(6910.9,DJN,1,"A",I,0))
- +10 IF '$PIECE($GET(^ENG(6910.9,DJN,1,J,0)),U,7)
- SET K=I
- End DoDot:3
- if K
- QUIT
- +11 SET X="^"_$SELECT(K:K,1:V)
- End DoDot:2
- QUIT
- +12 IF XGRT="PREV"
- SET X="^U"
- QUIT
- +13 IF XGRT="NEXT"
- SET X="^D"
- QUIT
- End DoDot:1
- +14 if X=""
- SET DJSM=1
- +15 DO RESETKB^XGF
- +16 ;
- Z1 IF $LENGTH(X)>(DJLG-1)
- WRITE @IOBS," ",*7
- XECUTE XY
- if '$DATA(V(V))
- SET V(V)=""
- if V(V)'=""
- DO B
- if V(V)=""
- DO D
- WRITE V(V)
- if $DATA(DJDB)
- WRITE DJDB
- KILL DJDB
- XECUTE XY
- GOTO Z
- +1 IF X?1"^".E!(X?1"?".E)
- if '$DATA(V(V))
- SET V(V)=""
- if V(V)'=""
- DO B
- if V(V)=""
- DO D
- XECUTE XY
- WRITE @DJHIN
- XECUTE XY
- WRITE V(V)
- if $DATA(DJDB)
- WRITE DJDB
- WRITE @DJLIN
- KILL DJDB
- XECUTE XY
- QUIT
- +2 QUIT
- N READ !,"Repaint screen(Y/N): N//",DJX:DTIME
- IF DJX["?"
- WRITE !,*7,"Please enter 'Y'es or 'N'o."
- GOTO N
- +1 if "Yy"'[$EXTRACT(DJX)!(DJX="")
- QUIT
- SET DJSV=V
- DO N^ENJDPL
- SET V=DJSV
- QUIT
- B SET $PIECE(DJDB," ",DJJ(V)-$LENGTH(V(V)))=""
- QUIT
- D SET $PIECE(DJDB,".",DJJ(V))="."
- QUIT