VLIST XTRA HELP: MEMBER AND FILE PROPERTIES DOCUMENTATION | ||
vList members have the following properties that you can access using normal Lingo syntax for getting properties. propertyValue = member("vlist member").propertyName propertyValue = the propertyName of member("vlist member")
Example: variable = member("vlist").platform
You can get most of the same information about vList files by using slightly different syntax. propertyValue = vlist_instance.propertyName()
Example: fileLink = new xtra("vlist","data.lst") variable = fileLink.platform()
content - (Member property only) The data stored within the vList member. Members that have been created but have not yet had a list written to them have an initial content value of <Void> if their content type has been set to Empty or Unique Value in the properties dialog box, or [ ] or [ : ] if their content type has been set to Linear or Property. Example: put member("vlist member").content -- [1,2,3]
dirVersion - The Director version the member or file was created under if no list has yet been written to it. Otherwise the Director version running when the content contained by the member or file was last written to it.. Examples: put member("vlist member").dirVersion -- "7.0.2"
put vlist_instance.dirVersion() -- "8.5"
platform - The platform ("Macintosh" or "Windows") the member or file was created under if no data has yet been written to it. Otherwise the platform the movie was running on when the data contained by the member or file was written to it. Example: put member("vlist member").platform -- "Macintosh"
put vlist_instance.platform() -- "Windows"
count - The number of list items in the list contained by the vList member or file. If the data contained by the member or file is not a list, vList returns 1 for the property. Example: member("vlist member").content = ["a","b"] put member("vlist member").count -- 2
fileLink = new xtra("vlist","storage.lst") fileLink.write("Here is a string to store") put fileLink.count() -- 1
size - Number of bytes of memory that would be taken up by the data contained by the vList member or file if it was loaded from the member or file into a variable. The amount of memory required by a list depends on the data types stored. Example: put member("vlist member").size -- 24
fileLink = new xtra("vlist","storage.lst") fileLink.write("Here is a string to store") put fileLink.size() -- 74
sizeOnDisk - Number of bytes of disk space that would be taken up by the data contained by the vList member if it was written out to a vList file.The disk size required by a stored list depends on the data types stored. Example: put member("vlist member").sizeOnDisk -- 28
fileLink = new xtra("vlist","storage.lst") fileLink.write("Here is a string to store") put fileLink.sizeOnDisk() -- 156
contentType - The type of data contained by the vList member or file. Returns the same values as the Lingo ilk function does for built-in date types. Lingo's ilk property correctly returns "#instance" for vList Xtra instances in memory, so this property is necessary to look inside a vList member or file and get information about what kind of data is stored inside. Examples: newMem = new(#vList) put member(newMem).contentType -- #void member(newMem).content = member(5).media put member(newMem).contentType -- #media member(newMem).content = [#a:1,#b:2] put member(newMem).contentType -- #propList
fileLink = new xtra("vlist","storage.lst") fileLink.write(88) put fileLink.contentType() -- #integer
sorted - Whether or not the sort flag is on for the list contained by the vList member or file. Does not report the actual ordering of the contents. If the vList member or file does not contain a list, vList returns 0 for this property. Examples: put member("vlist member").sorted -- 0
put instance.sorted() -- 1
member ("vlist member").sort - (Member property only) Setting this property to true sorts the list contents and sets the sorted flag to true. Setting this property to false, turns off the flag but does not reorder the list contents. If the vList member does not contain a list setting this property does nothing. Note: You cannot sort an encrypted list member by setting this property to true. Instead, first extract the list using decrypt, then use the built-in sort function on the list in memory. Example: member("vlist member").content = ["fish","dog"] put member("vlist member").sorted -- 0 member("vlist member").sort = true put member("vlist member").sorted -- 1 put member("vlist member").content -- ["dog","fish"] member("vlist member").sort = false put member("vlist member").content -- ["dog","fish"] put member("vlist member").sorted -- 0
encrypted - Whether or not the data contained by the vList member or file is encrypted. Examples: member("vlist member").content = ["fish","dog"] put member("vlist member").encrypted -- 0 listToStore = ["One phrase string"] member("vlist member").encrypt(listToStore, [ 41, 82, 79, 255, 35, 23]) put member("vlist member").encrypted -- 1
put instance.encrypted() -- 1
fileName - (File property only) The full filepath to the file linked to the vList instance. The file itself may not yet exist if no write has yet occurred. In Shockwave, returns just the filename, not the full path. Note: If you have not yet saved your movie in authoring there will be no moviePath to build the full file path from if you specified only a file name when creating the file link. In this case the function returns only the file name. Example: instance = new xtra("vlist","data.lst") -- Since no path was specified the file will be created in the same -- directory as the movie put the moviepath -- "Macintosh HD:Project:" put instance.fileName() -- "Macintosh HD:Project:data.lst"
compressed - Whether or not the data contained by the vList member or file is compressed. Examples: vlistMem = new(#vlist) member(vlistMem).content = ["fish","dog"] put member(vlistMem).compressed -- 0 vlistMem = new(#vlist) member(vlistMem).compression = true member(vlistMem).content = ["fish","dog"] put member(vlistMem).compressed -- 1
afile = new xtra("vlist","datafile.lst") afile.compression (true) write(afile, ["fish","dog"] ) put afile.compressed() -- 1
compressionratio - The percentage of disk space saved by compression. Examples: vlistMem = new(#vlist) member(vlistMem).compression = true member(vlistMem).content = member("bitmap").media put member(vlistMem).compressionratio -- 54.237
afile = new xtra("vlist","datafile.lst") afile.compression (true) afile.write( member("bitmap").media ) put afile.compressionratio() -- 54.237
binaryContent - Whether or not the string data inside a vlist file or member will be crossmapped when it is read on the opposite platform. This property tells you whether binaryMode was turned on when the data was written to the container. Examples: -- file inst = new xtra("vlist","%foo.lst") inst.binaryMode(true) inst.write(numToChar(255)) alert(string(inst.binaryContent())) -- 1 -- member mem = new(#vlist) mem.binaryMode = true mem.content = numToChar(255) alert(string(mem.binaryContent)) -- 1 |