Changeset 40 for ccr/trunk/p/GPLCCR0.m
- Timestamp:
- Jul 3, 2008, 9:02:47 PM (17 years ago)
- File:
-
- 1 edited
-
ccr/trunk/p/GPLCCR0.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/GPLCCR0.m
r36 r40 1 GPLCCR0 ; CCDCCR/GPL - CCR TEMPLATE AND ACCESS ROUTINES; 5/31/082 ;;0.1;CCDCCR;nopatch;noreleasedate3 W "This is a CCR TEMPLATE with processing routines",!4 W !5 Q6 ;1 GPLCCR0 ; CCDCCR/GPL - CCR TEMPLATE AND ACCESS ROUTINES; 5/31/08 2 ;;0.1;CCDCCR;nopatch;noreleasedate 3 W "This is a CCR TEMPLATE with processing routines",! 4 W ! 5 Q 6 ; 7 7 ZT(ZARY,BAT,LINE) ; private routine to add a line to the ZARY array 8 ; ZARY IS PASSED BY NAME9 ; BAT is a string identifying the section10 ; LINE is a test which will evaluate to true or false11 ; I '$G(@ZARY) D12 . S @ZARY@(0)=0 ; initially there are no elements13 . W "GOT HERE LOADING "_LINE,!14 N CNT ; count of array elements15 S CNT=@ZARY@(0) ; contains array count16 S CNT=CNT+1 ; increment count17 S @ZARY@(CNT)=LINE ; put the line in the array18 ; S @ZARY@(BAT,CNT)="" ; index the test by battery19 S @ZARY@(0)=CNT ; update the array counter20 Q21 ;8 ; ZARY IS PASSED BY NAME 9 ; BAT is a string identifying the section 10 ; LINE is a test which will evaluate to true or false 11 ; I '$G(@ZARY) D 12 . S @ZARY@(0)=0 ; initially there are no elements 13 . W "GOT HERE LOADING "_LINE,! 14 N CNT ; count of array elements 15 S CNT=@ZARY@(0) ; contains array count 16 S CNT=CNT+1 ; increment count 17 S @ZARY@(CNT)=LINE ; put the line in the array 18 ; S @ZARY@(BAT,CNT)="" ; index the test by battery 19 S @ZARY@(0)=CNT ; update the array counter 20 Q 21 ; 22 22 ZLOAD(ZARY,ROUTINE) ; load tests into ZARY which is passed by reference 23 ; ZARY IS PASSED BY NAME24 ; ZARY = name of the root, closed array format (e.g., "^TMP($J)")25 ; ROUTINE = NAME OF THE ROUTINE - PASSED BY VALUE26 K @ZARY S @ZARY=""27 S @ZARY@(0)=0 ; initialize array count28 N LINE,LABEL,BODY29 N INTEST S INTEST=0 ; switch for in the TEMPLATE section30 N SECTION S SECTION="[anonymous]" ; NO section LABEL31 ;32 N NUM F NUM=1:1 S LINE=$T(+NUM^@ROUTINE) Q:LINE="" D33 . I LINE?." "1";<TEMPLATE>".E S INTEST=1 ; entering section34 . I LINE?." "1";</TEMPLATE>".E S INTEST=0 ; leaving section35 . I INTEST D ; within the section36 . . I LINE?." "1";><".E D ; sub-section name found37 . . . S SECTION=$P($P(LINE,";><",2),">",1) ; pull out name38 . . I LINE?." "1";;".E D ; line found39 . . . D ZT(ZARY,SECTION,$P(LINE,";;",2)) ; put the line in the array40 Q41 ;23 ; ZARY IS PASSED BY NAME 24 ; ZARY = name of the root, closed array format (e.g., "^TMP($J)") 25 ; ROUTINE = NAME OF THE ROUTINE - PASSED BY VALUE 26 K @ZARY S @ZARY="" 27 S @ZARY@(0)=0 ; initialize array count 28 N LINE,LABEL,BODY 29 N INTEST S INTEST=0 ; switch for in the TEMPLATE section 30 N SECTION S SECTION="[anonymous]" ; NO section LABEL 31 ; 32 N NUM F NUM=1:1 S LINE=$T(+NUM^@ROUTINE) Q:LINE="" D 33 . I LINE?." "1";<TEMPLATE>".E S INTEST=1 ; entering section 34 . I LINE?." "1";</TEMPLATE>".E S INTEST=0 ; leaving section 35 . I INTEST D ; within the section 36 . . I LINE?." "1";><".E D ; sub-section name found 37 . . . S SECTION=$P($P(LINE,";><",2),">",1) ; pull out name 38 . . I LINE?." "1";;".E D ; line found 39 . . . D ZT(ZARY,SECTION,$P(LINE,";;",2)) ; put the line in the array 40 Q 41 ; 42 42 LOAD(ARY) ; LOAD A CCR TEMPLATE INTO ARY PASSED BY NAME 43 D ZLOAD(ARY,"GPLCCR0")44 ; ZWR @ARY45 Q46 ;43 D ZLOAD(ARY,"GPLCCR0") 44 ; ZWR @ARY 45 Q 46 ; 47 47 ;<TEMPLATE> 48 48 ;;<?xml version="1.0" encoding="UTF-8"?>
Note:
See TracChangeset
for help on using the changeset viewer.
