Changeset 1586 for ccr/trunk/p/C0CCCD1.m


Ignore:
Timestamp:
Oct 30, 2012, 1:11:02 PM (12 years ago)
Author:
Sam Habiel
Message:

Changed license to AGPL. Some clean-up for XINDEX

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ccr/trunk/p/C0CCCD1.m

    r1544 r1586  
    11C0CCCD1 ; CCDCCR/GPL - CCD TEMPLATE AND ACCESS ROUTINES; 6/7/08
    2         ;;1.2;C0C;;May 11, 2012;Build 47
     2        ;;1.2;CCD/CCR GENERATION UTILITIES;;Oct 30, 2012;Build 50
    33        ;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        ;
    2523ZT(ZARY,BAT,LINE)       ; private routine to add a line to the ZARY array
    26                  ; ZARY IS PASSED BY NAME
    27                  ; BAT is a string identifying the section
    28                  ; LINE is a test which will evaluate to true or false
    29                  ; I '$G(@ZARY) D  ; IF ZARY DOES NOT EXIST '
    30                  ; . S @ZARY@(0)=0 ; initially there are no elements
    31                  ; . W "GOT HERE LOADING "_LINE,!
    32                  N CNT ; count of array elements
    33                  S CNT=@ZARY@(0) ; contains array count
    34                  S CNT=CNT+1 ; increment count
    35                  S @ZARY@(CNT)=LINE ; put the line in the array
    36                  ; S @ZARY@(BAT,CNT)="" ; index the test by battery
    37                  S @ZARY@(0)=CNT ; update the array counter
    38                  Q
    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        ;
    4038ZLOAD(ZARY,ROUTINE)     ; load tests into ZARY which is passed by reference
    41                  ; ZARY IS PASSED BY NAME
    42                  ; ZARY = name of the root, closed array format (e.g., "^TMP($J)")
    43                  ; ROUTINE = NAME OF THE ROUTINE - PASSED BY VALUE
    44                  K @ZARY S @ZARY=""
    45                  S @ZARY@(0)=0 ; initialize array count
    46                  N LINE,LABEL,BODY
    47                  N INTEST S INTEST=0 ; switch for in the TEMPLATE section
    48                  N SECTION S SECTION="[anonymous]" ; NO section LABEL
    49                  ;
    50                  N NUM F NUM=1:1 S LINE=$T(+NUM^@ROUTINE) Q:LINE=""  D
    51                  . I LINE?." "1";<TEMPLATE>".E S INTEST=1 ; entering section
    52                  . I LINE?." "1";</TEMPLATE>".E S INTEST=0 ; leaving section
    53                  . I INTEST  D  ; within the section
    54                  . . I LINE?." "1";><".E  D  ; sub-section name found
    55                  . . . S SECTION=$P($P(LINE,";><",2),">",1) ; pull out name
    56                  . . I LINE?." "1";;".E  D  ; line found
    57                  . . . D ZT(ZARY,SECTION,$P(LINE,";;",2)) ; put the line in the array
    58                  Q
    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        ;
    6058LOAD(ARY)       ; LOAD A CCR TEMPLATE INTO ARY PASSED BY NAME
    61                  D ZLOAD(ARY,"C0CCCD1")
    62                  ; ZWR @ARY
    63                  Q
    64                  ;
     59        D ZLOAD(ARY,"C0CCCD1")
     60        ; ZWR @ARY
     61        Q
     62        ;
    6563TRMCCD     ; ROUTINE TO BE WRITTEN TO REMOVE CCR MARKUP FROM CCD
    66                  Q
     64        Q
    6765MARKUP  ;<MARKUP>
    6866        ;;<Body>
Note: See TracChangeset for help on using the changeset viewer.