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

DIM.m

Go to the documentation of this file.
  1. DIM ;SFISC/JFW,GFT,TOAD-FileMan: M Syntax Checker, Main ;28APR2016
  1. ;;22.2;VA FileMan;;Jan 05, 2016;Build 42
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;;Submitted to OSEHRA 5 January 2015 by the VISTA Expertise Network.
  1. ;;Based on Medsphere Systems Corporation's MSC FileMan 1051.
  1. ;;Licensed under the terms of the Apache License, Version 2.0.
  1. ;
  1. S %X=X,%END="",%ERR=0,%LAST="" G ER:X'?.ANP
  1. ;
  1. GC ; get next command on line (*)
  1. G ER:%ERR,LAST:";"[$E(%X) F Q:$E(%X)'=" " S %X=$E(%X,2,999)
  1. G ER:"BCDEFGHIKLMNOQRSUWXZ"'[$E(%X)
  1. S %LAST=%X D SEP G ER:%ERR S %COM=$P(%ARG,":") ; command word
  1. I $L(%COM)>1 D G ER:%ERR
  1. . I $T(COMMAND)'[(";"_%COM_";"),%COM'?1"Z"1.U S %ERR=1
  1. . E S %COM=$E(%COM)
  1. S %=$P(%ARG,":",2,99),%COM(1)=% I %ARG[":",%="" G ER ; command postcond
  1. I %]"" D ^DIM1 G ER:%ERR
  1. D SEP G ER:%ERR I %ARG="","CDGMORSUWXZ"[%COM G ER ; argument list
  1. S %END=%ARG G @%COM
  1. ;
  1. B G GC:%ARG=""&(%COM(1)=""),BK^DIM4
  1. C G CL^DIM4
  1. D G DG^DIM3
  1. E G GC:%ARG=""&(%COM(1)=""),ER
  1. F G ER:%COM(1)]""!(";"[$E(%X)),GC:%ARG="",FR^DIM3 ;GFT-DON'T END WITH 'F'
  1. G G DG^DIM3
  1. H G GC:%ARG=""&(%COM(1)="")&(%X]""),HN^DIM3:%ARG]"",ER Q
  1. I G ER:%COM(1)]"",IX^DIM4
  1. K G GC:%ARG=""&(%COM(1)="")&(%X]""),KL^DIM3:%ARG]"",ER
  1. L G LK^DIM3
  1. M G S
  1. N G ER:%ARG=""&(%X=""),K
  1. O G OP^DIM3
  1. Q G ER:%ARG]"",GC:%ARG=""&(%COM(1)=""),BK^DIM4
  1. R G RD^DIM4
  1. S G ST^DIM4
  1. U G OP^DIM3
  1. W G WR^DIM4
  1. X G IX^DIM4
  1. Z G GC
  1. ;
  1. SEP ; remove first " "-piece of %X into %ARG: parse commands (GC)
  1. F %I=1:1 S %C=$E(%X,%I) D:%C="""" Q:" "[%C
  1. . N %OUT S %OUT=0 F D Q:%OUT!%ERR
  1. . . S %I=%I+1,%C=$E(%X,%I) I %C="" S %ERR=1 Q
  1. . . Q:%C'="""" S %I=%I+1,%C=$E(%X,%I) Q:%C="""" S %OUT=1
  1. S %ARG=$E(%X,1,%I-1),%I=%I+1,%X=$E(%X,%I,999)
  1. Q
  1. ;
  1. COMMAND ;;BREAK;CLOSE;DO;ELSE;FOR;GOTO;HALT;HANG;IF;KILL;LOCK;MERGE;NEW;OPEN;QUIT;READ;SET;USE;WRITE;XECUTE;
  1. ;
  1. LAST ; check to ensure no trailing "," at end of command (GC)
  1. S %L=$L(%LAST),$E(%LAST,%L+1-$L(%X),%L)=""
  1. I $E(%END,$L(%END))="," G ER
  1. ;I $E(%X)="",$E(%LAST,%L)=" " G ER Trailing space is OK
  1. G END
  1. ;
  1. ER K X
  1. END K %,%A,%A1,%A2,%ARG,%C1,%C,%COM,%END,%ERR,%H,%I,%L,%LAST,%P,%X,%Z Q