Changeset 40 for ccr/trunk/p/GPLCCR0.m
- Timestamp:
- Jul 3, 2008, 9:02:47 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/GPLCCR0.m
r36 r40 1 GPLCCR0 2 3 4 5 6 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 9 10 11 12 13 14 15 16 17 18 19 20 21 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 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 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 44 45 46 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.