home *** CD-ROM | disk | FTP | other *** search
/ VCD Film, Television & An…on Creation Encyclopedia / mycd.iso / Direct5 / DATA.Z / LISTS.DIR / 00009.ls < prev    next >
Encoding:
Text File  |  1996-03-15  |  3.2 KB  |  103 lines

  1. on startMovie
  2.   global mylinearlist, mypropertylist
  3.   put EMPTY into field "pValue"
  4.   put EMPTY into field "pProperty"
  5.   set mylinearlist to []
  6.   set mypropertylist to [:]
  7.   put EMPTY into field "lValue"
  8.   put EMPTY into field "showlist"
  9.   put EMPTY into field "pValue"
  10.   put EMPTY into field "pProperty"
  11.   put EMPTY into field "totalmembers"
  12.   put EMPTY into field "formattedlist"
  13.   when keyDown then ┬¼
  14.      if the key = RETURN or key = ENTER then enterinfo
  15. end
  16.  
  17. on enterinfo
  18.   global mylinearlist
  19.   dontPassEvent()
  20.   append(mylinearlist, the text of cast "lValue")
  21.   set the text of cast "showlist" to string(mylinearlist)
  22.   formattedlist()
  23.   put EMPTY into field "lValue"
  24.   updateStage()
  25. end
  26.  
  27. on sortinfo
  28.   global mylinearlist
  29.   sort(mylinearlist)
  30.   set the text of cast "showlist" to string(mylinearlist)
  31.   formattedlist()
  32.   updateStage()
  33. end
  34.  
  35. on formattedlist
  36.   global mylinearlist, mypropertylist
  37.   set compiledlist to "mylinearlist" & RETURN
  38.   set the text of cast "totalmembers" to string(count(mylinearlist))
  39.   repeat with t = 1 to count(mylinearlist)
  40.     set currentlistmember to getAt(mylinearlist, t)
  41.     put "(" & string(t) & ") " & string(currentlistmember) & RETURN after compiledlist
  42.   end repeat
  43.   set the text of cast "formattedlist" to compiledlist
  44. end
  45.  
  46. on propertyenterinfo
  47.   global mypropertylist
  48.   dontPassEvent()
  49.   set propName to stripSpacesOutOfString(the text of cast "pProperty")
  50.   if (propName = EMPTY) or (integerp(value(propName)) = 1) then
  51.     alert("You need a non-blank, non-integer property name. Please try again.")
  52.   else
  53.     set charOneOfName to char 1 of propName
  54.     if integerp(value(charOneOfName)) = 1 then
  55.       alert("The first character of a property name can't be an integer.                Please try again.")
  56.     else
  57.       set propValue to the text of cast "pValue"
  58.       addProp(mypropertylist, propName, EMPTY)
  59.       do("set the " & propName & " of mypropertylist = " & propValue)
  60.       put the text of cast "showlist"
  61.       set temp to string(mypropertylist)
  62.       put "list is " & mypropertylist & "  The string temp version is " & temp
  63.       set the text of cast "showlist" to string(mypropertylist)
  64.       propertyformattedlist()
  65.       put EMPTY into field "pValue"
  66.       put EMPTY into field "pProperty"
  67.       updateStage()
  68.     end if
  69.   end if
  70. end
  71.  
  72. on propertysortinfo
  73.   global mypropertylist
  74.   sort(mypropertylist)
  75.   set the text of cast "showlist" to string(mypropertylist)
  76.   propertyformattedlist()
  77.   updateStage()
  78. end
  79.  
  80. on propertyformattedlist
  81.   global mypropertylist
  82.   set compiledlist to "mypropertylist" & RETURN
  83.   set the text of cast "totalmembers" to string(count(mypropertylist))
  84.   repeat with t = 1 to count(mypropertylist)
  85.     set currentlistmember to getPropAt(mypropertylist, t)
  86.     put ", " & getAt(mypropertylist, t) after currentlistmember
  87.     put "(" & string(t) & ") " & string(currentlistmember) & RETURN after compiledlist
  88.   end repeat
  89.   set the text of cast "formattedlist" to compiledlist
  90. end
  91.  
  92. on stripSpacesOutOfString psString
  93.   set lsReturnString to EMPTY
  94.   set counter to 1
  95.   repeat with i = 1 to length(psString)
  96.     if char i of psString <> " " then
  97.       set lsReturnString to lsReturnString & char i of psString
  98.       set counter to counter + 1
  99.     end if
  100.   end repeat
  101.   return lsReturnString
  102. end
  103.