ECOBARG ;BP/CMF - Argument Object
;;2.0;EVENT CAPTURE;**100**;8 May 96;Build 21
;@author - Chris Flegel
;@date - 17 May 2009
;@version - 1.0
;;
Q
;; private methods
;;
PARSE(PARSE,VALUE) ;
D PARSE^ECOB(PARSE,VALUE)
Q
;;
PROPERTY(HANDLE,SCOPE,PROPERTY,VALUE) ;
D PROPERTY^ECOB(HANDLE,SCOPE,PROPERTY,VALUE)
Q
;;
SETARG(RESULT,ARGUMENT) ;
; argument=(name.count[handle]).method.(additional.params...)
N HANDLE
S ARGUMENT=$G(ARGUMENT)
D PARSE("Handle",ARGUMENT)
D SET^ECOB(.RESULT,HANDLE,"Pu","Argument",ARGUMENT)
D SET^ECOB(.RESULT,HANDLE,"Pu","Count",$P(ARGUMENT,".",2))
D SET^ECOB(.RESULT,HANDLE,"Pu","Handle",HANDLE)
D SET^ECOB(.RESULT,HANDLE,"Pu","Name",$P(ARGUMENT,".",1))
D SET^ECOB(.RESULT,HANDLE,"Pu","Method",$P(ARGUMENT,".",3))
D SET^ECOB(.RESULT,HANDLE,"Pu","Params",$P(ARGUMENT,".",4,99))
Q
;;
;; public methods
CREATE(NAME) ;
; call parent first
N HANDLE,CHILD
S HANDLE=$$CREATE^ECOB(NAME)
D SELF^ECOB(.RESULT,HANDLE,"Method","Method","METHOD^ECOBM(.RESULT,ARGUMENT)","ECOB2")
;;
D PROPERTY(HANDLE,"Pu","Argument","")
D PROPERTY(HANDLE,"Pu","Count","")
D PROPERTY(HANDLE,"Pu","Handle","")
D PROPERTY(HANDLE,"Pu","Name","")
D PROPERTY(HANDLE,"Pu","Method","")
D PROPERTY(HANDLE,"Pu","Params","")
; complex properties last
Q HANDLE
;;
DESTROY(HANDLE) ;
; call parent last
Q $$DESTROY^ECOB(HANDLE)
;;
METHOD(RESULT,ARGUMENT) ;
; argument=(name.count[handle]).method.(additional.params...)
N CHILD,HANDLE,METHOD,PARAMS
D PARSE("Handle",ARGUMENT)
D PARSE("Method",ARGUMENT)
D PARSE("Params",ARGUMENT)
I METHOD="SetArgument" D SETARG(.RESULT,ARGUMENT) Q
S RESULT="-1^Invalid Argument"
Q
;;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HECOBARG 1717 printed Nov 22, 2024@17:08:11 Page 2
ECOBARG ;BP/CMF - Argument Object
+1 ;;2.0;EVENT CAPTURE;**100**;8 May 96;Build 21
+2 ;@author - Chris Flegel
+3 ;@date - 17 May 2009
+4 ;@version - 1.0
+5 ;;
+6 QUIT
+7 ;; private methods
+8 ;;
PARSE(PARSE,VALUE) ;
+1 DO PARSE^ECOB(PARSE,VALUE)
+2 QUIT
+3 ;;
PROPERTY(HANDLE,SCOPE,PROPERTY,VALUE) ;
+1 DO PROPERTY^ECOB(HANDLE,SCOPE,PROPERTY,VALUE)
+2 QUIT
+3 ;;
SETARG(RESULT,ARGUMENT) ;
+1 ; argument=(name.count[handle]).method.(additional.params...)
+2 NEW HANDLE
+3 SET ARGUMENT=$GET(ARGUMENT)
+4 DO PARSE("Handle",ARGUMENT)
+5 DO SET^ECOB(.RESULT,HANDLE,"Pu","Argument",ARGUMENT)
+6 DO SET^ECOB(.RESULT,HANDLE,"Pu","Count",$PIECE(ARGUMENT,".",2))
+7 DO SET^ECOB(.RESULT,HANDLE,"Pu","Handle",HANDLE)
+8 DO SET^ECOB(.RESULT,HANDLE,"Pu","Name",$PIECE(ARGUMENT,".",1))
+9 DO SET^ECOB(.RESULT,HANDLE,"Pu","Method",$PIECE(ARGUMENT,".",3))
+10 DO SET^ECOB(.RESULT,HANDLE,"Pu","Params",$PIECE(ARGUMENT,".",4,99))
+11 QUIT
+12 ;;
+13 ;; public methods
CREATE(NAME) ;
+1 ; call parent first
+2 NEW HANDLE,CHILD
+3 SET HANDLE=$$CREATE^ECOB(NAME)
+4 DO SELF^ECOB(.RESULT,HANDLE,"Method","Method","METHOD^ECOBM(.RESULT,ARGUMENT)","ECOB2")
+5 ;;
+6 DO PROPERTY(HANDLE,"Pu","Argument","")
+7 DO PROPERTY(HANDLE,"Pu","Count","")
+8 DO PROPERTY(HANDLE,"Pu","Handle","")
+9 DO PROPERTY(HANDLE,"Pu","Name","")
+10 DO PROPERTY(HANDLE,"Pu","Method","")
+11 DO PROPERTY(HANDLE,"Pu","Params","")
+12 ; complex properties last
+13 QUIT HANDLE
+14 ;;
DESTROY(HANDLE) ;
+1 ; call parent last
+2 QUIT $$DESTROY^ECOB(HANDLE)
+3 ;;
METHOD(RESULT,ARGUMENT) ;
+1 ; argument=(name.count[handle]).method.(additional.params...)
+2 NEW CHILD,HANDLE,METHOD,PARAMS
+3 DO PARSE("Handle",ARGUMENT)
+4 DO PARSE("Method",ARGUMENT)
+5 DO PARSE("Params",ARGUMENT)
+6 IF METHOD="SetArgument"
DO SETARG(.RESULT,ARGUMENT)
QUIT
+7 SET RESULT="-1^Invalid Argument"
+8 QUIT
+9 ;;