MAC AE

From Pickwiki
Revision as of 23:48, 26 February 2015 by Conversion script (talk) (link fix)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This is a utility to convert Camel Case to PICK.VARIABLES.

     subroutine mac_ae(mat junk)
*
* convert [[CamelCase]] to PICK.VARIABLES
*
     equate this to junk(1)
     qt = '"\':"'"
     atts = dcount(this,@am)

     for here = 1 to atts
        line = this<here>
        mine = upcase(field(trim(line),' ',1))
        flag = @false
        if mine ne 'REMOVE' then
           if mine[1,3] eq 'REM' then flag = @true
           if mine[1,1] eq '*' then flag = @true
           if mine[1,1] eq '!' then flag = @true
        end
*
* if it's a comment, we don't do it
        if flag then continue
*
        xxno = len(line)
        mine = ''
        flag = ''
        obit = ''
        for xx = 1 to xxno
           bit = line[xx,1]
           bat = line[xx+1,1]
           begin case
              case bit eq flag ; flag = ''
              case flag ne ''
              case index(qt,bit,1) ; flag = bit
              case bit eq ';'
                 test = trim(line[xx+1,999999])[1,1]
                 if test eq '*' or test eq '!' then flag = @am
              case alpha(bit)
                 if bit eq upcase(bit) and alpha(obit)
                    then bit = '.':bit
                 bit = upcase(bit)
              case 1 ; null
           end case
           mine = mine:bit
           obit = bit
        next xx
        this<here> = mine
     next here
     return