DOMAJ DXLIB TIPS
How do I return a list to Director?
Director lists can be passed as strings to Delphi and returned as strings.
In Director you must use the VALUE() function to cast the string back to a list.
Here is a sample unit.
Below is a Director Movie Script:
on testList
--parse a property list to Delphi and return it
--modified to director
aList=[:]
addProp aList, #a,"ONE"
put "original aList = " & aList
aList=value(myListMethod(aList))
put "Returned List=" & aList
put "type=" & ilk(aList)
put "#c=" & getProp(aList,#c)
--parse a linear list to Delphi and return it
--modified to Director
bList=[1,2,3]
put "original aList = " & bList
bList=value(mylinearListMethod(bList))
put "Returned List=" & bList
put "type=" & ilk(bList)
put "[2]=" & bList[2]
-- create a list from scratch
cList=[:]
cList=value(myDelphiList())
put "Created List=" & cList
put "#b=" & getProp(cList,#b)
end
Lastly, Here is the Message Window output:
testlist
-- "original aList = [#a: "ONE"]"
-- "Returned List=[#a: "1", #b: "2", #c: "3", #d: "FOUR"]"
-- "type=propList"
-- "#c=3"
-- "original aList = [1, 2, 3]"
-- "Returned List=[9, 8, 7, 6]"
-- "type=list"
-- "[2]=8"
-- "Created List=[#a: "1", #b: "TWO", #c: "3"]"
-- "#b=TWO"
DXLIB TIPS INDEX
- When I use sendMessage, the message does not appear
in the Director message window. Why?
- How do I return a value to Director?.
- What is the results interface?
- Field properties.
- How do I trigger the mouseUp handler?
- How do I add my own function to an asset?
- How do I add my own function to a sprite?
- How do I manipulate the score?
- How do I show delphi forms?
- How do I define and use my own variables?
- How do I create and and read global variables and
their values?
- How do I create a behavior?
- How do I trigger a script in Director?
- How do I get the properties of a cast member?(31Mar03)
- How do I manipulate casts?
- How do I debug an XTRA?
- How do I draw a castmember icon?
- How do I add my own resource file bitmap as the
castmember icon?
- How do I add a Director property interface
- Using the bitmap media property of a castmember
(30Apr02)
- How do I return a list to Director (09May02)
- How to create, execute and delete a Director script
(08Oct02)
- How to create a Director Bitmap (09Oct02)
- How to export a Director Bitmap (15Oct02)
DOMAJ Links
