home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1996 August / WPCAUG96.ISO / multi / singing / shared.dxr / 01978_FIXES.ls < prev    next >
Encoding:
Text File  |  1996-06-12  |  1.7 KB  |  87 lines

  1. on makelower c
  2.   set startUpper to charToNum("A")
  3.   set startlower to charToNum("a")
  4.   set n to charToNum(c)
  5.   if n < startlower then
  6.     set n to n - startUpper + startlower
  7.   end if
  8.   return numToChar(n)
  9. end
  10.  
  11. on isPunc c
  12.   return getPos([" ", ".", ",", ";", ":", "'", RETURN], c) > 0
  13. end
  14.  
  15. on isDigit c
  16.   return getPos(["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"], c) > 0
  17. end
  18.  
  19. on isRoman c
  20.   set answer to 0
  21.   repeat with checkagainst = 0 to 25
  22.     if (charToNum(c) = (checkagainst + charToNum("a"))) or (charToNum(c) = (checkagainst + charToNum("A"))) then
  23.       set answer to 1
  24.       exit repeat
  25.     end if
  26.   end repeat
  27.   return answer
  28. end
  29.  
  30. on FixLetter c
  31.   global weird
  32.   if isRoman(c) then
  33.     set c to makelower(c)
  34.   else
  35.     set weird to 1
  36.   end if
  37.   return c
  38. end
  39.  
  40. on FixName n
  41.   set answer to char 1 of n
  42.   repeat with i = 2 to the number of chars in n
  43.     set answer to answer & FixLetter(char i of n)
  44.   end repeat
  45.   return answer
  46. end
  47.  
  48. on FixCastNames first, last
  49.   global weird
  50.   repeat with i = first to last
  51.     set n to the name of cast i
  52.     set weird to 0
  53.     set n to FixName(n)
  54.     if weird then
  55.       put i && n
  56.       next repeat
  57.     end if
  58.     set the name of cast i to n
  59.   end repeat
  60. end
  61.  
  62. on CorrectWeirdChar
  63.   set BadList to []
  64.   set FixList to []
  65. end
  66.  
  67. on FixWeirdChars
  68. end
  69.  
  70. on CheckCast cn
  71.   put "CAST:" && the name of cast cn & RETURN
  72.   set charList to []
  73.   repeat with i = 1 to the number of chars in the text of field cn
  74.     set testChar to char i of the text of field cn
  75.     if not isRoman(testChar) and not isPunc(testChar) and not isDigit(testChar) then
  76.       append(charList, testChar)
  77.     end if
  78.   end repeat
  79.   put charList
  80. end
  81.  
  82. on CheckLots
  83.   repeat with i = 331 to 360
  84.     CheckCast(i)
  85.   end repeat
  86. end
  87.