Changeset 1586 for ccr/trunk/p/C0CCCD1.m
- Timestamp:
- Oct 30, 2012, 1:11:02 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CCCD1.m
r1544 r1586 1 1 C0CCCD1 ; CCDCCR/GPL - CCD TEMPLATE AND ACCESS ROUTINES; 6/7/08 2 ;;1.2;C 0C;;May 11, 2012;Build 472 ;;1.2;CCD/CCR GENERATION UTILITIES;;Oct 30, 2012;Build 50 3 3 ;Copyright 2008,2009 George Lilly, University of Minnesota. 4 ;Licensed under the terms of the GNU General Public License. 5 ;See attached copy of the License. 6 ; 7 ;This program is free software; you can redistribute it and/or modify 8 ;it under the terms of the GNU General Public License as published by 9 ;the Free Software Foundation; either version 2 of the License, or 10 ;(at your option) any later version. 11 ; 12 ;This program is distributed in the hope that it will be useful, 13 ;but WITHOUT ANY WARRANTY; without even the implied warranty of 14 ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 ;GNU General Public License for more details. 16 ; 17 ;You should have received a copy of the GNU General Public License along 18 ;with this program; if not, write to the Free Software Foundation, Inc., 19 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 ; 21 W "This is a CCD TEMPLATE with processing routines",! 22 W ! 23 Q 24 ; 4 ; 5 ; This program is free software: you can redistribute it and/or modify 6 ; it under the terms of the GNU Affero General Public License as 7 ; published by the Free Software Foundation, either version 3 of the 8 ; License, or (at your option) any later version. 9 ; 10 ; This program is distributed in the hope that it will be useful, 11 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 ; GNU Affero General Public License for more details. 14 ; 15 ; You should have received a copy of the GNU Affero General Public License 16 ; along with this program. If not, see <http://www.gnu.org/licenses/>. 17 ; 18 ; 19 W "This is a CCD TEMPLATE with processing routines",! 20 W ! 21 Q 22 ; 25 23 ZT(ZARY,BAT,LINE) ; private routine to add a line to the ZARY array 26 27 28 29 30 31 32 33 34 35 36 37 38 39 24 ; ZARY IS PASSED BY NAME 25 ; BAT is a string identifying the section 26 ; LINE is a test which will evaluate to true or false 27 ; I '$G(@ZARY) D ; IF ZARY DOES NOT EXIST ' 28 ; . S @ZARY@(0)=0 ; initially there are no elements 29 ; . W "GOT HERE LOADING "_LINE,! 30 N CNT ; count of array elements 31 S CNT=@ZARY@(0) ; contains array count 32 S CNT=CNT+1 ; increment count 33 S @ZARY@(CNT)=LINE ; put the line in the array 34 ; S @ZARY@(BAT,CNT)="" ; index the test by battery 35 S @ZARY@(0)=CNT ; update the array counter 36 Q 37 ; 40 38 ZLOAD(ZARY,ROUTINE) ; load tests into ZARY which is passed by reference 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 39 ; ZARY IS PASSED BY NAME 40 ; ZARY = name of the root, closed array format (e.g., "^TMP($J)") 41 ; ROUTINE = NAME OF THE ROUTINE - PASSED BY VALUE 42 K @ZARY S @ZARY="" 43 S @ZARY@(0)=0 ; initialize array count 44 N LINE,LABEL,BODY 45 N INTEST S INTEST=0 ; switch for in the TEMPLATE section 46 N SECTION S SECTION="[anonymous]" ; NO section LABEL 47 ; 48 N NUM F NUM=1:1 S LINE=$T(+NUM^@ROUTINE) Q:LINE="" D 49 . I LINE?." "1";<TEMPLATE>".E S INTEST=1 ; entering section 50 . I LINE?." "1";</TEMPLATE>".E S INTEST=0 ; leaving section 51 . I INTEST D ; within the section 52 . . I LINE?." "1";><".E D ; sub-section name found 53 . . . S SECTION=$P($P(LINE,";><",2),">",1) ; pull out name 54 . . I LINE?." "1";;".E D ; line found 55 . . . D ZT(ZARY,SECTION,$P(LINE,";;",2)) ; put the line in the array 56 Q 57 ; 60 58 LOAD(ARY) ; LOAD A CCR TEMPLATE INTO ARY PASSED BY NAME 61 62 63 64 59 D ZLOAD(ARY,"C0CCCD1") 60 ; ZWR @ARY 61 Q 62 ; 65 63 TRMCCD ; ROUTINE TO BE WRITTEN TO REMOVE CCR MARKUP FROM CCD 66 64 Q 67 65 MARKUP ;<MARKUP> 68 66 ;;<Body>
Note:
See TracChangeset
for help on using the changeset viewer.