home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1997 December / WPCDEC97.ISO / DXRS / INXWDEC.DXR / 00028_CDXUpdateList.ls < prev    next >
Encoding:
Text File  |  1997-10-13  |  1.2 KB  |  31 lines

  1. on CDXUpdateList
  2.   global CDXresultlist, WhichINXfieldnamesList, WhichINXfieldlengthlist, CDrecordsfound, CDpageselect
  3.   add(CDXresultlist, [0, 0, 0, 0, 0, 0])
  4.   repeat with j = 1 to count(WhichINXfieldnamesList)
  5.     set fname to getAt(WhichINXfieldnamesList, j)
  6.     set flength to getAt(WhichINXfieldlengthlist, j)
  7.     DBGetFieldByName(fname)
  8.     set fieldcontent to the result
  9.     if fname = "CD_ISSUE" then
  10.       if (value(chars(fieldcontent, 5, 6)) < 1) or (value(chars(fieldcontent, 5, 6)) > 12) then
  11.         nothing()
  12.       else
  13.         set months to list("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
  14.         set monthnumber to value(chars(fieldcontent, 5, 6))
  15.         set newmonthtext to getAt(months, monthnumber) && chars(fieldcontent, 3, 4)
  16.         set fieldcontent to newmonthtext
  17.       end if
  18.     end if
  19.     set datalength to the number of chars in fieldcontent
  20.     if datalength < flength then
  21.       repeat with g = 1 to flength - datalength
  22.         set fieldcontent to fieldcontent & " "
  23.       end repeat
  24.     end if
  25.     if datalength > flength then
  26.       set fieldcontent to chars(fieldcontent, 1, flength)
  27.     end if
  28.     setAt(getAt(CDXresultlist, count(CDXresultlist)), j, fieldcontent)
  29.   end repeat
  30. end
  31.