home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global mylinearlist, mypropertylist
- put EMPTY into field "pValue"
- put EMPTY into field "pProperty"
- set mylinearlist to []
- set mypropertylist to [:]
- put EMPTY into field "lValue"
- put EMPTY into field "showlist"
- put EMPTY into field "pValue"
- put EMPTY into field "pProperty"
- put EMPTY into field "totalmembers"
- put EMPTY into field "formattedlist"
- when keyDown then ¬
- if the key = RETURN or key = ENTER then enterinfo
- end
-
- on enterinfo
- global mylinearlist
- dontPassEvent()
- append(mylinearlist, the text of cast "lValue")
- set the text of cast "showlist" to string(mylinearlist)
- formattedlist()
- put EMPTY into field "lValue"
- updateStage()
- end
-
- on sortinfo
- global mylinearlist
- sort(mylinearlist)
- set the text of cast "showlist" to string(mylinearlist)
- formattedlist()
- updateStage()
- end
-
- on formattedlist
- global mylinearlist, mypropertylist
- set compiledlist to "mylinearlist" & RETURN
- set the text of cast "totalmembers" to string(count(mylinearlist))
- repeat with t = 1 to count(mylinearlist)
- set currentlistmember to getAt(mylinearlist, t)
- put "(" & string(t) & ") " & string(currentlistmember) & RETURN after compiledlist
- end repeat
- set the text of cast "formattedlist" to compiledlist
- end
-
- on propertyenterinfo
- global mypropertylist
- dontPassEvent()
- set propName to stripSpacesOutOfString(the text of cast "pProperty")
- if (propName = EMPTY) or (integerp(value(propName)) = 1) then
- alert("You need a non-blank, non-integer property name. Please try again.")
- else
- set charOneOfName to char 1 of propName
- if integerp(value(charOneOfName)) = 1 then
- alert("The first character of a property name can't be an integer. Please try again.")
- else
- set propValue to the text of cast "pValue"
- addProp(mypropertylist, propName, EMPTY)
- do("set the " & propName & " of mypropertylist = " & propValue)
- put the text of cast "showlist"
- set temp to string(mypropertylist)
- put "list is " & mypropertylist & " The string temp version is " & temp
- set the text of cast "showlist" to string(mypropertylist)
- propertyformattedlist()
- put EMPTY into field "pValue"
- put EMPTY into field "pProperty"
- updateStage()
- end if
- end if
- end
-
- on propertysortinfo
- global mypropertylist
- sort(mypropertylist)
- set the text of cast "showlist" to string(mypropertylist)
- propertyformattedlist()
- updateStage()
- end
-
- on propertyformattedlist
- global mypropertylist
- set compiledlist to "mypropertylist" & RETURN
- set the text of cast "totalmembers" to string(count(mypropertylist))
- repeat with t = 1 to count(mypropertylist)
- set currentlistmember to getPropAt(mypropertylist, t)
- put ", " & getAt(mypropertylist, t) after currentlistmember
- put "(" & string(t) & ") " & string(currentlistmember) & RETURN after compiledlist
- end repeat
- set the text of cast "formattedlist" to compiledlist
- end
-
- on stripSpacesOutOfString psString
- set lsReturnString to EMPTY
- set counter to 1
- repeat with i = 1 to length(psString)
- if char i of psString <> " " then
- set lsReturnString to lsReturnString & char i of psString
- set counter to counter + 1
- end if
- end repeat
- return lsReturnString
- end
-