Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DDBRAHTR

DDBRAHTR.m

Go to the documentation of this file.
DDBRAHTR ;SFISC/DCL-BROWSER ANCHOR & HYPERTEXT PROCESSOR REVERSE TAB ;NOV 04, 1996@13:52
 ;;22.2;VA FileMan;;Jan 05, 2016;Build 42
 ;;Per VA Directive 6402, this routine should not be modified.
 ;;Submitted to OSEHRA 5 January 2015 by the VISTA Expertise Network.
 ;;Based on Medsphere Systems Corporation's MSC FileMan 1051.
 ;;Licensed under the terms of the Apache License, Version 2.0.
 ;
 Q
REVTAB ; Reverse Tab
 S DDBRHT=$G(DDBRHT)
 I $P(DDBRHT,DDGLDEL,4)'=DDBSA S DDBRHT=""
 N LIM,ULCLR,ULNEW
 S LIM=DDBL,ULCLR=DDBRHT'>0,ULNEW=0
PSR ;S DDBL=$S(DDBL'>DDBSRL:0,1:DDBL-DDBSRL)
 D SDLR($S(DDBL'>DDBSRL:0,1:DDBL-DDBSRL)+1)
 Q
SDLR(L) N I,J,SFR,STO
 I +DDBRHT<L!(+DDBRHT>LIM) S DDBRHT="",ULCLR=1
 S DX=0,SFR=$P(DDBSY,";",3),STO=$P(DDBSY,";",2),L=L+DDBSRL
 F I=SFR:-1:STO S L=L-1 Q:$S(DDBZN:$D(@DDBSA@(L,0)),1:$D(@DDBSA@(L)))
 S (SFR,DY)=I X IOXY
 F I=SFR:-1:STO D
 .I $D(@DDBSA@(L)) S X=$S(DDBZN:@DDBSA@(L,0),1:@DDBSA@(L)),L=L-1
 .E  Q
 .I ULCLR,ULNEW Q
 .Q:$L(X,"$.%")'>2
 .S WRF=0,J=$P(X,"$.%",$P(DDBRHT,DDGLDEL,3)),X=$$HTD(X,L+1)
 .I +DDBRHT,J=$P(DDBRHT,DDGLDEL,2) S ULCLR=1,WRF=1
 .Q:'WRF
 .S DY=I
 .X IOXY
 .W $P(DDGLCLR,DDGLDEL),X
 .Q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