home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / GLYPH.ZIP / OBJECTS.TLB < prev    next >
Encoding:
Text File  |  1988-05-31  |  17.6 KB  |  585 lines

  1. <<title Object Definitions Library>>
  2. <<uicode>>
  3.  
  4. function pgheader
  5. param pgnumber
  6.     private ldate,lfile,lpage,lline
  7.     if ! (pgnumber < 2)
  8.      ?
  9.     endif
  10.     ldate = ampm({time})+", {date}"
  11.     lfile = upper(trim(wwfile))
  12.     lpage = "Page {pgnumber}"
  13.     lline = ldate+space(40-((len(lfile)/2)+len(ldate)) )+lfile
  14.     lline = lline+space(80-(len(lline)+len(lpage)))+lpage
  15.     ? lline
  16.     ?
  17.     ?
  18.     lnctr = 4
  19. return(pgnumber+1)
  20.  
  21. function environment
  22.     sectheader("Environment",0)
  23.     ? align("Flavor : "+;
  24.         iif(db3,"dBASE III",iif(db3plus,"dBASE III Plus","Clipper")),32)
  25.     ? align("MRD Calls : "+iif(mrd,"Enabled","Disabled"),32)
  26.     ? align(".WW Directory : "+upper(trim(wwdir)),32)
  27.     ? align(".DBF Directory : "+upper(trim(dbfdir)),32)
  28.     ? align(".TEM Directory : "+upper(trim(temdir)),32)
  29.     ? align(".PRG Directory : "+upper(trim(gendir)),32)
  30.     ?
  31.     lnctr = lnctr + 7
  32. return
  33.  
  34. function objsummary
  35.     sectheader("Object Summary",0)
  36.     ? align("Databases Used : {number_of_dbfs()}",32)
  37.     ? align("Indexes Referenced : {number_of_indexes()}",32)
  38.     ? align("Fields : {number_of_fields()}",32)
  39.     ? align("Memory Variables : {number_of_memvars()}",32)
  40.     ? align("Variables Total : {number_of_vars()}",32)
  41.     ? align("Boxes Defined : {number_of_boxes()}",32)
  42.     ? align("Options Defined : {number_of_options()}",32)
  43.     ?
  44.     lnctr = lnctr + 8
  45. return
  46.  
  47. function scrdump
  48.     private row,delim1,delim2
  49.     sectheader("Screen Image",0)
  50.     delim1 = "          1         2         3         "+;
  51.                "4         5         6         7"
  52.     delim2 = "01234567890123456789012345678901234567890"+;
  53.         "123456789012345678901234567890123456789"
  54.     ? delim1
  55.     ? delim2
  56.     for row = 0 to 24
  57.      ? text_at(row,0)
  58.     endfor
  59.     ? delim2
  60.     ? delim1
  61.     ?
  62.     lnctr = lnctr + 30
  63. return
  64.  
  65. function dbfsummary
  66.     private dbflimit,dptr
  67.     sectheader("Database Summary",0)
  68.     if ! (number_of_dbfs() > 0)
  69.      ? "        < No Databases Defined >"
  70.      ?
  71.      lnctr = lnctr + 2
  72.      return
  73.     endif
  74.     dptr = 1
  75.     do while ! (dptr > number_of_dbfs())
  76.      if (lnctr > 48)
  77.           ? chr(12)
  78.           pgctr = pgheader(pgctr)
  79.           sectheader("Database Summary",1)
  80.           ?
  81.           lnctr = lnctr + 1
  82.      endif
  83.      ? align("Database : {upper(dbf_array[dptr].name)}",32)
  84.      ? align("Alias : {dbf_array[dptr].alias}",32)
  85.      ? align("Select Area : {dbf_array[dptr].area}",32)
  86.      ? align("Fields Referenced : {dbf_array[dptr].refs}",32)
  87.      lineout = align("Field List : ",32)
  88.      cmpstr = upper(trim(dbf_array[dptr].name))
  89.      fldlimit = number_of_fields()
  90.      fptr = 1
  91.      do while ! (fptr > fldlimit)
  92.           if (upper(trim(field_array[fptr].dbf)) = cmpstr)
  93.            if (len(lineout) > 68)
  94.             ? substr(lineout,1,len(lineout)-1)
  95.             lineout = space(33)
  96.             lnctr = lnctr + 1
  97.            endif
  98.            lineout = "{lineout}{field_array[fptr].name},"
  99.           endif
  100.           fptr = fptr + 1
  101.      enddo
  102.      ? substr(lineout,1,len(lineout)-1)
  103.      ?
  104.      lnctr = lnctr + 6
  105.      dptr = dptr + 1
  106.     enddo
  107. return
  108.  
  109. function idxsummary
  110.     private iptr,tmp,lineout
  111.     sectheader("Index Summary",0)
  112.     if ! (number_of_indexes() > 0)
  113.      ? "          < No Indexes Defined >"
  114.      ?
  115.      lnctr = lnctr + 2
  116.      return
  117.     endif
  118.     ? "Index        Expression"
  119.     ?
  120.     lnctr = lnctr + 2
  121.     iptr = 1
  122.     do while ! (iptr > number_of_indexes())
  123.      if lnctr > 58
  124.           ? chr(12)
  125.           ? pgctr = pgheader(pgctr)
  126.           sectheader("Index Summary",1)
  127.           ? "Index        Expression"
  128.           ?
  129.           lnctr = lnctr + 2
  130.      endif
  131.      tmp = upper(trim(stripdir(index_array[iptr].name)))
  132.      lineout = substr(tmp+space(13),1,13)
  133.      tmp = trim(index_array[iptr].expr)
  134.      lineout = lineout+substr(tmp,1,min(56,len(tmp)))
  135.      ? lineout
  136.      lnctr = lnctr + 1
  137.      iptr = iptr + 1
  138.     enddo
  139. return
  140.  
  141. function fldsummary
  142.     private noapp,fptr,tmp,lineout
  143.     if (lnctr > 40)
  144.      ? chr(12)
  145.      pgctr = pgheader(pgctr)
  146.     endif
  147.     sectheader("Fields Summary",0)
  148.     if ! (number_of_fields() > 0)
  149.      ? "           < No Fields Defined >"
  150.      ?
  151.      lnctr = lnctr + 2
  152.      return
  153.     endif
  154. *        1      2        3          4     5      6
  155. *      123456789012345678901234567890123456789012345678901234567890123456789
  156.     ? "Field      Type Len Dec  Status   Row Col  Box        Database     Alias"
  157.     ?
  158.     noapp = replicate(chr(196),3)
  159.     fptr = 1
  160.     do while ! (fptr > number_of_fields())
  161.      if lnctr > 54
  162.           ? chr(12)
  163.           pgctr = pgheader(pgctr)
  164.           sectheader("Fields Summary",1)
  165.           ?
  166.           ? "Field      Type Len Dec  Status   Row "+;
  167.               "Col  Box        Database     Alias"
  168.           ?
  169.           lnctr = lnctr + 3
  170.      endif
  171.      lineout = upper(trim(field_array[fptr].name))+space(14)
  172.      lineout = substr(lineout,1,12)+field_array[fptr].type+space(3)
  173.      tmp = "{field_array[fptr].len}"
  174.      lineout = lineout+space(3-len(tmp))+tmp
  175.      tmp = "{field_array[fptr].dec}"
  176.      lineout = lineout+space(4-len(tmp))+tmp+space(2)+;
  177.         iif(field_array[fptr].input,"Input","Display")+space(10)
  178.      tmp = "{field_array[fptr].row}"
  179.      lineout = substr(lineout,1,34)+space(3-len(tmp))+tmp
  180.      tmp = "{field_array[fptr].col}"
  181.      lineout = substr(lineout,1,38)+space(4-len(tmp))+"{tmp}  "
  182.      tmp = trim(field_array[fptr].owner)
  183.      lineout = lineout+iif(len(tmp) < 1 .or. ctrl_in_str(tmp),;
  184.                           noapp,tmp)+space(11)
  185.      tmp = upper(trim(stripdir(field_array[fptr].dbf)))
  186.      lineout = substr(lineout,1,54)+tmp+space(11)
  187.      tmp = trim(field_array[fptr].alias)
  188.      lineout = substr(lineout,1,67)+iif(len(tmp) > 0,noapp,tmp)
  189.      ? lineout
  190.      lnctr = lnctr + 1
  191.      if detail
  192.           tmp = trim(field_array[fptr].init_val)
  193.           ? "    Initial Value : "+iif((len(tmp) < 1 .or. ;
  194.                       ctrl_in_str(tmp)),"<undef>",tmp)
  195.           tmp = trim(field_array[fptr].picture)
  196.           ? "   Picture Clause : "+iif((len(tmp) < 1 .or.;
  197.             ctrl_in_str(tmp)),"<undef>",iif(len(tmp)>56,;
  198.                    substr(tmp,1,52)+"..."+chr(34),tmp))
  199.           tmp = trim(field_array[fptr].valid)
  200.           ? "     Valid Clause : "+iif((len(tmp) < 1 .or. ;
  201.                  ctrl_in_str(tmp)),"<undef>",tmp)
  202.           tmp = trim(field_array[fptr].range)
  203.           ? "     Range Clause : "+iif((len(tmp) < 1 .or.;
  204.                     ctrl_in_str(tmp)),"<undef>",tmp)
  205.           tmp = trim(field_array[fptr].slot1)
  206.           lnctr = lnctr + 4
  207.           if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
  208.            ? "     Field Slot 1 : "+substr(tmp,1,min(60,len(tmp)))
  209.            lnctr = lnctr + 1
  210.           endif
  211.           tmp = trim(field_array[fptr].slot2)
  212.           if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
  213.            ? "     Field Slot 2 : "+substr(tmp,1,min(60,len(tmp)))
  214.            lnctr = lnctr + 1
  215.           endif
  216.           tmp = trim(field_array[fptr].slot3)
  217.           if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
  218.            ? "     Field Slot 3 : "+substr(tmp,1,min(60,len(tmp)))
  219.            lnctr = lnctr + 1
  220.           endif
  221.           ?
  222.           lnctr = lnctr + 1
  223.      endif
  224.      fptr = fptr + 1
  225.     enddo
  226. return
  227.  
  228. function memsummary
  229.     private noapp,mptr,tmp,lineout
  230.     if (lnctr > 40)
  231.      ? chr(12)
  232.      pgctr = pgheader(pgctr)
  233.     endif
  234.     sectheader("MemVar Summary",0)
  235.     if ! (number_of_memvars() > 0)
  236.      ? "          < No MemVars Defined >"
  237.      ?
  238.      lnctr = lnctr + 2
  239.      return
  240.     endif
  241. *        1      2        3          4     5      6
  242. *      123456789012345678901234567890123456789012345678901234567890123456789
  243.     ? "Variable   Type Len Dec  Status   Row Col  Box"
  244.     ?
  245.     noapp = replicate(chr(196),3)
  246.     mptr = 1
  247.     do while ! (mptr > number_of_memvars())
  248.      if lnctr > 54
  249.           ? chr(12)
  250.           pgctr = pgheader(pgctr)
  251.           sectheader("MemVar Summary",1)
  252.           ?
  253.           ? "Variable   Type Len Dec  Status   Row Col  Box"
  254.           ?
  255.           lnctr = lnctr + 3
  256.      endif
  257.      lineout = upper(trim(memvar_array[mptr].name))+space(14)
  258.      lineout = substr(lineout,1,12)+memvar_array[mptr].type+space(3)
  259.      tmp = "{memvar_array[mptr].len}"
  260.      lineout = lineout+space(3-len(tmp))+tmp
  261.      tmp = "{memvar_array[mptr].dec}"
  262.      lineout = lineout+space(4-len(tmp))+tmp+space(2)+;
  263.         iif(memvar_array[mptr].input,"Input","Display")+space(10)
  264.      tmp = "{memvar_array[mptr].row}"
  265.      lineout = substr(lineout,1,34)+space(3-len(tmp))+tmp
  266.      tmp = "{memvar_array[mptr].col}"
  267.      lineout = substr(lineout,1,38)+space(4-len(tmp))+"{tmp}  "
  268.      tmp = trim(memvar_array[mptr].owner)
  269.      lineout = lineout+iif(len(tmp) < 1 .or. ctrl_in_str(tmp),;
  270.                           noapp,tmp)+space(11)
  271.      ? lineout
  272.      lnctr = lnctr + 1
  273.      if detail
  274.           tmp = trim(memvar_array[mptr].init_val)
  275.           ? "    Initial Value : "+iif((len(tmp) < 1 .or. ;
  276.                       ctrl_in_str(tmp)),"<undef>",tmp)
  277.           tmp = trim(memvar_array[mptr].picture)
  278.           ? "   Picture Clause : "+iif((len(tmp) < 1 .or.;
  279.             ctrl_in_str(tmp)),"<undef>",iif(len(tmp)>56,;
  280.                    substr(tmp,1,52)+"..."+chr(34),tmp))
  281.           tmp = trim(memvar_array[mptr].valid)
  282.           ? "     Valid Clause : "+iif((len(tmp) < 1 .or. ;
  283.                  ctrl_in_str(tmp)),"<undef>",tmp)
  284.           tmp = trim(memvar_array[mptr].range)
  285.           ? "     Range Clause : "+iif((len(tmp) < 1 .or.;
  286.                     ctrl_in_str(tmp)),"<undef>",tmp)
  287.           tmp = trim(memvar_array[mptr].slot1)
  288.           lnctr = lnctr + 4
  289.           if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
  290.            ? "     Field Slot 1 : "+substr(tmp,1,min(60,len(tmp)))
  291.            lnctr = lnctr + 1
  292.           endif
  293.           tmp = trim(memvar_array[mptr].slot2)
  294.           if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
  295.            ? "     Field Slot 2 : "+substr(tmp,1,min(60,len(tmp)))
  296.            lnctr = lnctr + 1
  297.           endif
  298.           tmp = trim(memvar_array[mptr].slot3)
  299.           if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
  300.            ? "     Field Slot 3 : "+substr(tmp,1,min(60,len(tmp)))
  301.            lnctr = lnctr + 1
  302.           endif
  303.           ?
  304.           lnctr = lnctr + 1
  305.      endif
  306.      mptr = mptr + 1
  307.     enddo
  308. return
  309.  
  310. function boxsummary
  311.     private bptr,tmp,lineout
  312.     sectheader("Boxes Summary",0)
  313.     if ! (number_of_boxes() > 0)
  314.      ? "            < No Boxes Defined >"
  315.      ?
  316.      lnctr = lnctr + 2
  317.      return
  318.     endif
  319. *        1      2        3          4     5      6
  320. *      123456789012345678901234567890123456789012345678901234567890123456789
  321.     ? "Name              Row Col Height Width Outline     Border Contents PopUp"
  322.     ?
  323.     bptr = 1
  324.     do while ! (bptr > number_of_boxes())
  325.      if lnctr > 48
  326.           ? chr(12)
  327.           pgctr = pgheader(pgctr)
  328.           sectheader("Boxes Summary",1)
  329.           ?
  330.           ? "Name              Row Col Height Width "+;
  331.              "Outline     Border Contents PopUp"
  332.           ?
  333.           lnctr = lnctr + 3
  334.      endif
  335.      tmp = "{box_array[bptr].name}"
  336.      lineout = iif(len(tmp) < 1 .or. ctrl_in_str(tmp),"<undef>",tmp)+;
  337.                                     space(20)
  338.      tmp = "{box_array[bptr].row}"
  339.      lineout = substr(lineout,1,18)+space(3-len(tmp))+"{tmp} "
  340.      tmp = "{box_array[bptr].col}"
  341.      lineout = lineout+space(3-len(tmp))+"{tmp} "
  342.      tmp = "{box_array[bptr].height}"
  343.      lineout = lineout+space(6-len(tmp))+"{tmp} "
  344.      tmp = "{box_array[bptr].width}"
  345.      lineout = lineout+space(5-len(tmp))+"{tmp} "
  346.      if (box_array[bptr].outline.type)
  347.           tmp = chr(34)+trim(box_array[bptr].outline.string)+chr(34)
  348.      else
  349.           tmp = "<none>"
  350.      endif
  351.      lineout = lineout+tmp+space(10)
  352.      tmp = trim(box_array[bptr].outline.color)
  353.      lineout = substr(lineout,1,51)+tmp+space(10)
  354.      tmp = trim(box_array[bptr].contents.color)
  355.      lineout = substr(lineout,1,58)+tmp+space(10)
  356.      tmp = iif(box_array[bptr].popup,"Yes","No")
  357.      lineout = substr(lineout,1,67)+tmp
  358.      ? lineout
  359.      lnctr = lnctr + 1
  360.      if detail
  361.           tmp = trim(box_array[bptr].slot1)
  362.           if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
  363.            ? "  Box Slot 1 : "+substr(tmp,1,min(60,len(tmp)))
  364.            lnctr = lnctr + 1
  365.           endif
  366.           tmp = trim(box_array[bptr].slot2)
  367.           if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
  368.            ? "  Box Slot 2 : "+substr(tmp,1,min(60,len(tmp)))
  369.            lnctr = lnctr + 1
  370.           endif
  371.           tmp = trim(box_array[bptr].slot3)
  372.           if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
  373.            ? "  Box Slot 3 : "+substr(tmp,1,min(60,len(tmp)))
  374.            lnctr = lnctr + 1
  375.           endif
  376.           dumpbox(box_array[bptr])
  377.           ?
  378.           lnctr = lnctr + 1
  379.      endif
  380.      bptr = bptr + 1
  381.     enddo
  382. return
  383.  
  384. function optsummary
  385.     private optr,tmp,lineout
  386.     if lnctr > 48
  387.      ? chr(12)
  388.      pgctr = pgheader(pgctr)
  389.     endif
  390.     sectheader("Options Summary",0)
  391.     if ! (number_of_options() > 0)
  392.      ? "          < No Options Defined >"
  393.      ?
  394.      lnctr = lnctr + 2
  395.      return
  396.     endif
  397. *        1      2        3          4     5      6
  398. *      123456789012345678901234567890123456789012345678901234567890123456789
  399.     ? "                                                Selected      UnSelected"
  400.     ? "Name        Row Col Height Width Outline     Border Content Border "+;
  401.                                 "Content PopUp"
  402.     ?
  403.     lnctr = lnctr + 3
  404.     optr = 1
  405.     do while ! (optr > number_of_options())
  406.      if lnctr > 54
  407.           ? chr(12)
  408.           pgctr = pgheader(pgctr)
  409.           sectheader("Options Summary",1)
  410.           ?
  411.           ? "                                                "+;
  412.                            "Selected      UnSelected"
  413.           ? "Name        Row Col Height Width Outline     Border "+;
  414.                         "Content Border Content PopUp"
  415.           ?
  416.           lnctr = lnctr + 4
  417.      endif
  418.      tmp = "{option_array[optr].name}"
  419.      lineout = iif(len(tmp) < 1 .or. ctrl_in_str(tmp),"<undef>",tmp)+;
  420.                                      space(20)
  421.      tmp = "{option_array[optr].row}"
  422.      lineout = substr(lineout,1,12)+space(3-len(tmp))+tmp+space(1)
  423.      tmp = "{option_array[optr].col}"
  424.      lineout = lineout+space(3-len(tmp))+tmp+space(1)
  425.      tmp = "{option_array[optr].height}"
  426.      lineout = lineout+space(6-len(tmp))+tmp+space(1)
  427.      tmp = "{option_array[optr].width}"
  428.      lineout = lineout+space(5-len(tmp))+tmp+space(1)
  429.      if (option_array[optr].outline.type)
  430.           tmp = chr(34)+trim(option_array[optr].outline.string)+chr(34)
  431.      else
  432.           tmp = "<none>"
  433.      endif
  434.      lineout = lineout+tmp+space(10)
  435.      if (option_array[optr].outline.type)
  436.           tmp = trim(option_array[optr].outline.color.selected)
  437.      else
  438.           tmp = "<n/a>"
  439.      endif
  440.      lineout = substr(lineout,1,45)+tmp+space(10)
  441.      tmp = trim(option_array[optr].contents.color.selected)
  442.      lineout = substr(lineout,1,52)+tmp+space(10)
  443.      if (option_array[optr].outline.type)
  444.           tmp = trim(option_array[optr].outline.color.unselected)
  445.      else
  446.           tmp = "<n/a>"
  447.      endif
  448.      lineout = substr(lineout,1,60)+tmp+space(10)
  449.      tmp = trim(option_array[optr].contents.color.unselected)
  450.      lineout = substr(lineout,1,67)+tmp+space(10)
  451.      tmp = iif(option_array[optr].popup,"Yes","No")
  452.      lineout = substr(lineout,1,75)+tmp
  453.      ? lineout
  454.      lnctr = lnctr + 1
  455.      if detail
  456.           tmp = "{option_array[optr].trigger}"
  457.           ? "Option Trigger : "+iif(len(tmp) < 1 .or. ctrl_in_str(tmp),;
  458.                        "<undef>",tmp)
  459.           tmp = chr(34)+box_text(option_array[optr],0,0)+chr(34)
  460.           ? "   Option Text : "+tmp
  461. * ─────────────────────────────────────────────────────────────────────────
  462. *  The following commented code creates a FREESP uninitialized pointer error
  463. *  in the UI2 beta release one.
  464. *
  465. *          tmp = "{option_array[optr].message}"
  466. *          ? "Option Message : "+iif(len(tmp) < 1 .or. ctrl_in_str(tmp),;
  467. *                       "<undef>",tmp)
  468. *          tmp = "{option_array[optr].action[1]}"
  469. *          if (len(tmp) > 0 .and. (! ctrl_in_str(tmp)))
  470. *           ? " Option Action : "+tmp
  471. *           lnctr = lnctr + 1
  472. *           tmp = "{option_array[optr].action[2]}"
  473. *           if (len(tmp) > 0 .and. (! ctrl_in_str(tmp)))
  474. *            ? "                 "+tmp
  475. *            lnctr = lnctr + 1
  476. *           endif
  477. *           tmp = "{option_array[optr].action[3]}"
  478. *           if (len(tmp) > 0 .and. (! ctrl_in_str(tmp)))
  479. *            ? "                 "+tmp
  480. *            lnctr = lnctr + 1
  481. *           endif
  482. *           tmp = "{option_array[optr].action[4]}"
  483. *           if (len(tmp) > 0 .and. (! ctrl_in_str(tmp)))
  484. *            ? "                 "+tmp
  485. *            lnctr = lnctr + 1
  486. *           endif
  487. *           tmp = "{option_array[optr].action[5]}"
  488. *           if (len(tmp) > 0 .and. (! ctrl_in_str(tmp)))
  489. *            ? "                 "+tmp
  490. *            lnctr = lnctr + 1
  491. *           endif
  492. *          endif
  493. *          tmp = "{option_array[optr].slot1}"
  494. *          if (len(tmp) > 0 .and. (! ctrl_in_str(tmp)))
  495. *           ? " Option Slot 1 : "+tmp
  496. *           lnctr = lnctr + 1
  497. *          endif
  498. *          tmp = "{option_array[optr].slot2}"
  499. *          if (len(tmp) > 0 .and. (! ctrl_in_str(tmp)))
  500. *           ? " Option Slot 2 : "+tmp
  501. *           lnctr = lnctr + 1
  502. *          endif
  503. *          tmp = "{option_array[optr].slot3}"
  504. *          if (len(tmp) > 0 .and. (! ctrl_in_str(tmp)))
  505. *           ? " Option Slot 3 : "+tmp
  506. *           lnctr = lnctr + 1
  507. *          endif
  508.           ?
  509. *          lnctr = lnctr + 3
  510.           lnctr = lnctr + 1
  511.      endif
  512.      optr = optr + 1
  513.     enddo
  514. return
  515.  
  516.  
  517.  
  518. function sectheader
  519. param lstr,cflag
  520.     ?
  521.     ? replicate(chr(196),31-len(lstr))+" {lstr}"
  522.     ? iif(cflag>0,"{space(21)}(continued)"," ")
  523.     lnctr = lnctr + 3
  524. return
  525.  
  526. function dumpbox
  527. param bx
  528.     private row
  529.     ? "* {replicate(chr(196),76)} *"
  530.     for row = 0 to (bx.height - 1)
  531.      ? box_text(bx,row,0)
  532.     endfor
  533.     ? "* {replicate(chr(196),76)} *"
  534.     lnctr = lnctr + (bx.height+2)
  535. return
  536.  
  537. function align
  538. param lstr,column
  539. return(space(column-at(":",lstr))+lstr)
  540.  
  541. * ────────────────────────────────────────────────────────────── Primitives
  542.  
  543. function rjust
  544. param lstr,width
  545. return(space(width-len(lstr))+lstr)
  546.  
  547. function center
  548. param lstr,width
  549. return(space((width/2)-(len(lstr)/2))+lstr)
  550.  
  551. function replicate
  552. param s,n
  553.     private ls
  554.     ls = s
  555.     n = n - 1
  556.     do while (n > 0)
  557.     ls = ls + s
  558.     n = n - 1
  559.     enddo
  560. return ls
  561.  
  562. function min
  563. param p1,p2
  564. return(iif(p1>p2,p2,p1))
  565.  
  566. function max
  567. param p1,p2
  568. return(iif(p1>p2,p1,p2))
  569.  
  570. function ampm
  571. param lstime
  572.     colonpos = at(":",lstime)
  573.     lstime = substr(lstime,1,colonpos+2)
  574.     do case
  575.      case (val(lstime) < 12)
  576.           lstime = lstime+" am"
  577.      case (val(lstime) = 12)
  578.           lstime = lstime+" pm"
  579.     otherwise
  580.      lstime = ltrim(str(val(lstime)-12))+substr(lstime,colonpos,3)+" pm"
  581.     endcase
  582. return(lstime)
  583.  
  584. <<enduicode>>
  585.