- Timestamp:
- Jan 19, 2009, 4:00:55 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/GPLCCR0.m
r321 r338 18 18 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 19 ; 20 21 22 23 20 W "This is a CCR TEMPLATE with processing routines",! 21 W ! 22 Q 23 ; 24 24 ZT(ZARY,BAT,LINE) ; private routine to add a line to the ZARY array 25 26 27 28 29 30 31 32 33 34 35 36 37 38 25 ; ZARY IS PASSED BY NAME 26 ; BAT is a string identifying the section 27 ; LINE is a test which will evaluate to true or false 28 ; I '$G(@ZARY) D ; 29 ; . S @ZARY@(0)=0 ; initially there are no elements 30 ; . W "GOT HERE LOADING "_LINE,! 31 N CNT ; count of array elements 32 S CNT=@ZARY@(0) ; contains array count 33 S CNT=CNT+1 ; increment count 34 S @ZARY@(CNT)=LINE ; put the line in the array 35 ; S @ZARY@(BAT,CNT)="" ; index the test by battery 36 S @ZARY@(0)=CNT ; update the array counter 37 Q 38 ; 39 39 ZLOAD(ZARY,ROUTINE) ; load tests into ZARY which is passed by reference 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 40 ; ZARY IS PASSED BY NAME 41 ; ZARY = name of the root, closed array format (e.g., "^TMP($J)") 42 ; ROUTINE = NAME OF THE ROUTINE - PASSED BY VALUE 43 K @ZARY S @ZARY="" 44 S @ZARY@(0)=0 ; initialize array count 45 N LINE,LABEL,BODY 46 N INTEST S INTEST=0 ; switch for in the TEMPLATE section 47 N SECTION S SECTION="[anonymous]" ; NO section LABEL 48 ; 49 N NUM F NUM=1:1 S LINE=$T(+NUM^@ROUTINE) Q:LINE="" D 50 . I LINE?." "1";<TEMPLATE>".E S INTEST=1 ; entering section 51 . I LINE?." "1";</TEMPLATE>".E S INTEST=0 ; leaving section 52 . I INTEST D ; within the section 53 . . I LINE?." "1";><".E D ; sub-section name found 54 . . . S SECTION=$P($P(LINE,";><",2),">",1) ; pull out name 55 . . I LINE?." "1";;".E D ; line found 56 . . . D ZT(ZARY,SECTION,$P(LINE,";;",2)) ; put the line in the array 57 Q 58 ; 59 59 LOAD(ARY) ; LOAD A CCR TEMPLATE INTO ARY PASSED BY NAME 60 61 62 63 60 D ZLOAD(ARY,"GPLCCR0") 61 ; ZWR @ARY 62 Q 63 ; 64 64 ;<TEMPLATE> 65 65 ;;<?xml version="1.0" encoding="UTF-8"?>
Note:
See TracChangeset
for help on using the changeset viewer.