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

  1. on IsMember locList, locVal
  2.   return getPos(locList, locVal) <> 0
  3. end
  4.  
  5. on IsWhite locVal
  6.   return IsMember([" ", TAB, ENTER, RETURN], locVal)
  7. end
  8.  
  9. on IsUpper theChar
  10.   return (theChar >= "A") and (theChar <= "Z")
  11. end
  12.  
  13. on IsLower theChar
  14.   return (theChar >= "a") and (theChar <= "z")
  15. end
  16.  
  17. on isLetter theChar
  18.   return IsUpper(theChar) or IsLower(theChar)
  19. end
  20.  
  21. on GetSubStr str, a, b
  22.   set w to EMPTY
  23.   repeat with i = a to b
  24.     set w to w & char i of str
  25.   end repeat
  26.   return w
  27. end
  28.  
  29. on FindCharpos str, ch
  30.   set foundat to 0
  31.   repeat with i = 1 to the number of chars in str
  32.     if char i of str = ch then
  33.       set foundat to i
  34.       exit repeat
  35.     end if
  36.   end repeat
  37.   return foundat
  38. end
  39.  
  40. on Digit theChar
  41.   set theDigit to charToNum(theChar) - charToNum("0")
  42.   return theDigit
  43. end
  44.  
  45. on number theWord
  46.   set wordLen to length(theWord)
  47.   set digitValue to 1
  48.   set totalVal to 0
  49.   repeat with digitPos = wordLen down to 1
  50.     set totalVal to totalVal + (Digit(char digitPos of theWord) * digitValue)
  51.     set digitValue to digitValue * 10
  52.   end repeat
  53.   return totalVal
  54. end
  55.  
  56. on Red
  57.   if the colorDepth = 32 then
  58.     set theRed to 16711680
  59.   else
  60.     set theRed to 35
  61.   end if
  62.   return theRed
  63. end
  64.  
  65. on Blue
  66.   if the colorDepth = 32 then
  67.     set theBlue to 100
  68.   else
  69.     set theBlue to 240
  70.   end if
  71.   return theBlue
  72. end
  73.