error processing for empty strings

This commit is contained in:
george 2012-04-18 01:43:27 +00:00
parent c2787aa270
commit b0a8cc6699
1 changed files with 6 additions and 3 deletions

View File

@ -496,18 +496,21 @@ IENOFA(ZOUTARY,INARY,FARY) ; RESOLVE STRINGS TO IEN IN STRINGS FILE
. N ZK
. S ZK=$O(INARY(ZI,""))
. S ZINARY($$EXT^C0XUTIL(ZI),$$EXT^C0XUTIL(ZK))=""
N ZV,ZIEN
N ZV,ZIEN,ABORT
S ABORT=0
N ZCNT S ZCNT=0
F S ZI=$O(ZINARY(ZI)) Q:ZI="" D ; LOOK FOR MISSING STRINGS
F S ZI=$O(ZINARY(ZI)) Q:(ZI="")!+ABORT D ; LOOK FOR MISSING STRINGS
. S ZV=$O(ZINARY(ZI,""))
. I ZV="" S ABORT=1 Q ; abandon quad -- missing an entry
. I ZV["^" S ZV=$TR(ZV,"^","|")
. I $O(@C0XSN@("B",ZV,""))="" D ;
. . S ZCNT=ZCNT+1
. . S C0XFDA2(C0XSFN,"+"_ZCNT_",",.01)=ZV
I +ABORT Q ;
I $D(C0XFDA2) D ;
. D UPDIE(.C0XFDA2) ; ADD MISSING STRINGS
. K C0XFDA2 ; CLEAN UP
F S ZI=$O(ZINARY(ZI)) Q:ZI="" D ; NOT GET ALL IENS
F S ZI=$O(ZINARY(ZI)) Q:ZI="" D ; NOW GET ALL IENS
. S ZV=$O(ZINARY(ZI,""))
. I ZV["^" S ZV=$TR(ZV,"^","|")
. S ZIEN=$O(@C0XSN@("B",ZV,"")) ; THEY SHOULD BE THERE NOW