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

XBDIR.m

Go to the documentation of this file.
  1. XBDIR ; IHS/ADC/GTH - DIR INTERFACE ; [ 02/07/97 3:02 PM ]
  1. ;;3.0;IHS/VA UTILITIES;;FEB 07, 1997
  1. ;
  1. ; The purpose of routine XBDIR is to provide interface
  1. ; methodology for a call to ^DIR, to ensure correct handling
  1. ; of variables, and to provide for the expressiveness of an
  1. ; extrinsic function.
  1. ;
  1. ; There is no requirement to use the entry point, below.
  1. ;
  1. ; The format of the call is to SET a local variable to the
  1. ; output of the call to DIR^XBDIR(), which will be Y at the
  1. ; bottom of this routine, or, less likely, WRITE the value.
  1. ;
  1. ; An example of the call is:
  1. ; S %=$$DIR^XBDIR(<actual_parameter_list>)
  1. ; where the <actual_parameter_list> is:
  1. ;(DIR(0),DIR("A"),DIR("B"),DIR("T"),DIR("?"),DIR("??"),<skip>)
  1. ; where <skip> is the number of lines to skip before the call
  1. ; to ^DIR.
  1. ;
  1. ; Examples:
  1. ;
  1. ; S %=$$DIR^XBDIR("N^1:2","Select report method",2,"","Produ
  1. ; ce report by FY or Dates","^D HELP^<your_routine>",300,2)
  1. ;
  1. ; S <namespace>FY=$$DIR^XBDIR("NO","Object Class Code Summar
  1. ; y for FISCAL YEAR ",FY,$G(DTIME,500),"Enter a FOUR DIGIT F
  1. ; ISCAL YEAR","^D SB1^<your_routine>")
  1. ;
  1. ;
  1. DIR(O,A,B,T,Q,H,R) ;PEP - Extrinsic interface to ^DIR.
  1. I '$L($G(O)) Q -1
  1. NEW DA,DIR
  1. S DIR(0)=O
  1. I $D(A) D
  1. . I $L($G(A)) S DIR("A")=A
  1. . I $L($O(A(""))) S O="" F S O=$O(A(O)) Q:'$L(O) S DIR("A",O)=A(O)
  1. .Q
  1. I $L($G(B)) S DIR("B")=B
  1. I $G(T) S DIR("T")=T
  1. I $D(Q) D
  1. . I $L($G(Q)) S DIR("?")=Q
  1. . I $L($O(Q(""))) S O="" F S O=$O(Q(O)) Q:'$L(O) S DIR("?",O)=Q(O)
  1. .Q
  1. I $L($G(H)) S DIR("??")=H
  1. I $G(R) F A=1:1:R W !
  1. KILL O,A,B,T,Q,H,R,DTOUT,DUOUT,DIRUT,DIROUT
  1. D ^DIR
  1. Q Y
  1. ;