<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<!--This is an automatically generated file. DO NOT EDIT THIS FILE DIRECTLY. Rather, use the _ref.xml files found in the 'edits' folder.-->
<c74object name="coll" module="max" category="Data">
	<digest>
		Store and edit a collection of data
	</digest>
	<description>
		Allows for the storage, organization, editing, and retrieval of different messages.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			Data
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Single Item Outputs Data, Multiple Items Store Data
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Single Item Outputs Data, Multiple Items Store Data
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Data Contents
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				Number or Symbol Associated With Data
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="2" type="OUTLET_TYPE">
			<digest>
				bang When Finished Reading Data File
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="3" type="OUTLET_TYPE">
			<digest>
				bang When Finished With Dump Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="name" optional="1" type="symbol">
			<digest>
				Context and file name
			</digest>
			<description>
				Determines the named context of the <o>coll</o> object. All coll objects that share the same name share their contents. When a patch containing a named <o>coll</o> is loaded, Max will search for a file that matches the name; if found, the file is automatically loaded.
			</description>
			<discussion>
				For information about using named objects in Max for Live, click <link name="live_symbols" module="core" type="vignette">here</link>.
			</discussion>
		</objarg>
		<objarg name="no-search" optional="1" type="any">
			<digest>
				Suppress file load
			</digest>
			<description>
				An optional nonzero value as a second argument will prevent the <o>coll</o> object from searching for a file with the named symbol.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Retrieve the next data set
			</digest>
			<description>
				See the <m>next</m> listing.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="index" optional="0" type="int" />
			</arglist>
			<digest>
				Retrieve data by index
			</digest>
			<description>
				The number refers to the address of a message stored in <o>coll</o>. If a message is stored at that address, the stored message is output.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="index" optional="0" type="float" />
			</arglist>
			<digest>
				Retrieve data by index
			</digest>
			<description>
				The number refers to the address of a message stored in <o>coll</o>. If a message is stored at that address, the stored message is output.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="index" optional="0" type="int" />
				<arg name="data" optional="0" type="list" />
			</arglist>
			<digest>
				Store index and data
			</digest>
			<description>
				The first value is used as the address (the storage location within <o>coll</o>) at which to store the remaining items in the list. The address will always be stored as an int.
			</description>
			<discussion>
				The <o>coll</o> object can store a list of up to 32766 items.
			</discussion>
		</method>
		<method name="anything">
			<arglist>
				<arg name="index" optional="0" type="any" />
			</arglist>
			<digest>
				Retrieve data by symbol
			</digest>
			<description>
				See the <m>symbol</m> listing.
			</description>
		</method>
		<method name="assoc">
			<arglist>
				<arg name="address name" optional="0" type="symbol" />
				<arg name="data index" optional="0" type="int" />
			</arglist>
			<digest>
				Associate a name with an index
			</digest>
			<description>
				Associates a symbol with the numeric address, provided that the number address already exists. After association, any reference to that symbol will be interpreted as a reference to the number address. Each number address can have only one symbol associated with it.
			</description>
			<discussion>
				The address 0 cannot have an associated symbol.
				<br />
				If the symbol was already being used as an address, or was already associated with another number address, the data stored at that address is removed.
			</discussion>
		</method>
		<method name="deassoc">
			<arglist>
				<arg name="address name" optional="0" type="symbol" />
				<arg name="data index" optional="0" type="int" />
			</arglist>
			<digest>
				De-associate a name with an index
			</digest>
			<description>
				Removes the association between a symbol and the number address. The symbol will no longer have any meaning to <o>coll</o>.
			</description>
		</method>
		<method name="delete">
			<arglist>
				<arg name="index" optional="0" type="any" />
			</arglist>
			<digest>
				Remove data and renumber
			</digest>
			<description>
				Removes the data at the address provided. If the specified address is numeric, all higher numbered addresses are decremented by 1.
			</description>
		</method>
		<method name="clear">
			<arglist />
			<digest>
				Clear all data
			</digest>
			<description>
				TEXT_HERE
			</description>
		</method>
		<method name="(mouse)">
			<digest>
				Open a data editing window
			</digest>
			<description>
				Double-click on the <o>coll</o> object to display the contents as text in an editing window. The data can be manually edited within this editor.
			</description>
		</method>
		<method name="dump">
			<arglist />
			<digest>
				Output all data
			</digest>
			<description>
				Sends all of the stored addresses out the 2nd outlet and all of the stored messages out the 1st outlet, in the order in which they are stored. A <m>bang</m> is sent out the 4th outlet when the dump is completed.
			</description>
		</method>
		<method name="end">
			<arglist />
			<digest>
				Move to last address
			</digest>
			<description>
				Sets the pointer (as used by the <m>goto</m>, <m>next</m>, and <m>prev</m> messages) to the last address.
			</description>
		</method>
		<method name="goto">
			<arglist>
				<arg name="index" optional="0" type="list" />
			</arglist>
			<digest>
				Move to an index
			</digest>
			<description>
				Sets the pointer (as used by the <m>goto</m>, <m>next</m>, and <m>prev</m> messages) at a specific address, but does not trigger output. If the specified address does not exist, the pointer is set at the beginning of the collection. Data will be output in response to a subsequent <m>bang</m>, <m>next</m>, or <m>prev</m> message.
			</description>
		</method>
		<method name="filetype">
			<arglist>
				<arg name="filetype" optional="0" type="symbol" />
			</arglist>
			<digest>
				Set the recognized file types
			</digest>
			<description>
				Sets the file types which can be read and written into the <o>coll</o> object. The message <m>filetype</m> with no arguments restores the default file behavior.
			</description>
			<discussion>
				File types are mapped to filename extensions on Windows (or mac when no type is specified by OS) based on the messages to max contained in the file max-fileformats.txt in the init folder, which is loaded on startup. If you are defining your own filetype, you may want to include your own text file in the init folder in order to specify a mapping between an extension and your <link name="filetypes" module="core" type="vignette">four-letter filetype code</link>.
			</discussion>
		</method>
		<method name="flags">
			<arglist>
				<arg name="save-setting" optional="0" type="int" />
				<arg name="unused" optional="0" type="int" />
			</arglist>
			<digest>
				Set the file-save flag
			</digest>
			<description>
				Sets the flags used to save its contents within the patch that contains it. The message <m>flags 1 0</m> notifies the object to save its contents as part of the patcher file. The message <m>flags 0 0</m> causes the contents not to be saved.
			</description>
		</method>
		<method name="insert">
			<arglist>
				<arg name="index" optional="0" type="int" />
				<arg name="data" optional="0" type="list" />
			</arglist>
			<digest>
				Insert data at a specific address
			</digest>
			<description>
				Inserts the message at the address specified by the number, incrementing all equal or greater addresses by 1 if necessary.
			</description>
		</method>
		<method name="insert2">
			<arglist>
				<arg name="index" optional="0" type="int" />
				<arg name="data" optional="0" type="list" />
			</arglist>
			<digest>
				Insert data at a specific address
			</digest>
			<description>
				See the <m>insert</m> listing.
			</description>
		</method>
		<method name="length">
			<arglist />
			<digest>
				Retrieve the number of entries
			</digest>
			<description>
				Counts the number of entries contained in the <o>coll</o> and sends the number out the 1st outlet.
			</description>
		</method>
		<method name="next">
			<arglist />
			<digest>
				Move to the next address
			</digest>
			<description>
				Sends the address and data stored at the current address, then sets the pointer to the next address. If the pointer is currently at the last address in the collection, it wraps around to the first address. If the address is a symbol rather than a number, <m>0</m> is sent out the second outlet.
			</description>
			<discussion>
				Number addresses are stored in ascending order. Symbol addresses are stored in the order in which they were added to the collection, after all of the number addresses.) If the message received immediately prior to <m>next</m> was <m>prev</m>, <m>next</m> sends out the value stored at the address one greater than the one that was just sent out.
			</discussion>
		</method>
		<method name="nstore">
			<arglist>
				<arg name="index" optional="0" type="int" />
				<arg name="association" optional="0" type="symbol" />
				<arg name="data" optional="0" type="list" />
			</arglist>
			<digest>
				Store data with both number and symbol index
			</digest>
			<description>
				Stores the message at the specified number address, with the specified symbol associated. This has the same effect as storing the message at an int address, then using the <m>assoc</m> message to associate a symbol with that number.
			</description>
		</method>
		<method name="max">
			<arglist>
				<arg name="element" optional="1" type="int" />
			</arglist>
			<digest>
				Return the highest numeric value
			</digest>
			<description>
				Gets the highest value in any entry. An optional integer argument (defaults to '1') specifies an element position to use.
			</description>
		</method>
		<method name="merge">
			<arglist>
				<arg name="index" optional="0" type="int" />
				<arg name="data" optional="0" type="list" />
			</arglist>
			<digest>
				Merge data at an existing address
			</digest>
			<description>
				Appends data at the end of the data found at the specified index. If the address does not yet exist, it is created.
			</description>
		</method>
		<method name="nth">
			<arglist>
				<arg name="index" optional="0" type="int" />
				<arg name="position" optional="0" type="int" />
			</arglist>
			<digest>
				Return a single data element
			</digest>
			<description>
				Returns the data element found at a specific position in the stored list and send it out the first outlet. As an example, <m>nth 75 2</m> will output the second item in the list stored at address 75.
			</description>
		</method>
		<method name="nsub">
			<arglist>
				<arg name="index" optional="0" type="int" />
				<arg name="position" optional="0" type="int" />
				<arg name="data" optional="0" type="any" />
			</arglist>
			<digest>
				Replace a single data element
			</digest>
			<description>
				Replaces a data element with a new value. As an example, <m>nsub 2 4 7</m> replaces the fourth element of address 2 with the value 7. Number values and symbols can both be substituted in this manner.
			</description>
		</method>
		<method name="min">
			<arglist>
				<arg name="element" optional="1" type="int" />
			</arglist>
			<digest>
				Return the lowest numeric value
			</digest>
			<description>
				Gets the lowest value in any entry. An optional integer argument (defaults to '1') specifies an element position to use.
			</description>
		</method>
		<method name="prev">
			<arglist />
			<digest>
				Move to the previous address
			</digest>
			<description>
				Sends the address and data stored at the current address, then sets the pointer to the previous address. If the pointer is currently at the first address in the collection, it wraps around to the last address. If the address is a symbol rather than a number, <m>0</m> is sent out the second outlet.
			</description>
			<discussion>
				Number addresses are stored in ascending order. Symbol addresses are stored in the order in which they were added to the collection, after all of the number addresses.) If the message received immediately prior to <m>prev</m> was <m>next</m>, <m>prev</m> sends out the value stored at the address one greater than the one that was just sent out.
			</discussion>
		</method>
		<method name="open">
			<arglist />
			<digest>
				Open a data editing window
			</digest>
			<description>
				Opens a data editing window for the current data and bring it into focus.
			</description>
			<discussion>
				In addition to reading messages in from another file and storing messages via the inlet, one can also enter messages in <o>coll</o> manually. Double-clicking with the mouse on the <o>coll</o> object displays the contents as text in an editing window which the user can modify.
				<br />
				In order to edit a collection by hand or read in from another file, it is essential to know the correct text format for the contents of a <o>coll</o> object. Each message is stored in the on a separate line. The format of each line is as follows: the address (an int or a symbol), any symbols associated with that address (if the address is an int), a comma (to separate the address from the data it contains), the data (anything), and a semicolon to indicate the end of each line.
			</discussion>
		</method>
		<method name="separate">
			<arglist>
				<arg name="data index" optional="0" type="int" />
			</arglist>
			<digest>
				Creates an open entry index
			</digest>
			<description>
				Increments the numerical indices for all data whose index is greater than the provided. This creates an open 'slot' for a subsequent add.
			</description>
		</method>
		<method name="sort">
			<arglist>
				<arg name="sort order (-1 or 1)" optional="0" type="int" />
				<arg name="entry (-1, 0, or 1)" optional="0" type="int" />
			</arglist>
			<digest>
				Sort the data
			</digest>
			<description>
				Sorts the data into a specified order. If the first argument is <m>-1</m>, the items are sorted in ascending order. If the first argument is <m>1</m>, the items are sorted in descending order.
				<br />
				The second argument specifies what data is used to sort the contents. If the second argument is <m>-1</m>, the index (either number or symbol) associated with the data is used. If the second argument is not present or is <m>0</m>, the first item in the data is used. If the second argument is <m>1</m> or greater, that data elements is used for the sorting order.
			</description>
		</method>
		<method name="start">
			<arglist />
			<digest>
				Move to the first entry
			</digest>
			<description>
				Sets the pointer (used by the <m>goto</m>, <m>next</m>, and <m>prev</m> messages) to the first address in the <o>coll</o>.
			</description>
		</method>
		<method name="store">
			<arglist>
				<arg name="index" optional="0" type="symbol" />
				<arg name="data" optional="0" type="list" />
			</arglist>
			<digest>
				Store data at a symbolic index
			</digest>
			<description>
				Stores the message at an address named by the provided symbol. As an example, <m>store triad 0 4 7</m> will store <m>0 4 7</m> at an address named <m>triad</m>.
			</description>
		</method>
		<method name="subsym">
			<arglist>
				<arg name="new name" optional="0" type="symbol" />
				<arg name="old name" optional="0" type="symbol" />
			</arglist>
			<digest>
				Changes an index symbol
			</digest>
			<description>
				Changes the symbol associated with data. The first argument is the new symbol to use, the second argument is the symbol associator to replace.
			</description>
		</method>
		<method name="swap">
			<arglist>
				<arg name="index" optional="0" type="int" />
				<arg name="index" optional="0" type="int" />
			</arglist>
			<digest>
				Swap two indices
			</digest>
			<description>
				Exchanges the indices associated with two addresses. The data is unchanged, but the indexes that they use are swapped.
			</description>
		</method>
		<method name="symbol">
			<arglist>
				<arg name="index" optional="0" type="symbol" />
			</arglist>
			<digest>
				Retrieve data by symbol
			</digest>
			<description>
				Retrieves a message stored at the address named by the symbol. If no address is associated with the symbol, no output is produced.
			</description>
		</method>
		<method name="read">
			<arglist>
				<arg name="filename" optional="0" type="symbol" />
			</arglist>
			<digest>
				Choose a file to load
			</digest>
			<description>
				With no arguments, <m>read</m> puts up a standard Open Document dialog box to choose a file to load. If an argument is provided, the named file is loaded.
			</description>
		</method>
		<method name="readagain">
			<arglist />
			<digest>
				Reload a file
			</digest>
			<description>
				Loads the contents of the most recently read file. If no prior file load has occurred, the request is treated like a <m>read</m> message.
			</description>
		</method>
		<method name="refer">
			<arglist>
				<arg name="object name" optional="0" type="symbol" />
			</arglist>
			<digest>
				Change data reference
			</digest>
			<description>
				Changes the reference to the data in another named <o>coll</o> object. Changes to the data stored in any referenced <o>coll</o> will be shared by all other similarly named objects.
			</description>
		</method>
		<method name="remove">
			<arglist>
				<arg name="index" optional="0" type="any" />
			</arglist>
			<digest>
				Remove an entry
			</digest>
			<description>
				Removes that address and its contents from the collection.
			</description>
		</method>
		<method name="sub">
			<arglist>
				<arg name="index" optional="0" type="int" />
				<arg name="position" optional="0" type="int" />
				<arg name="data" optional="0" type="list" />
			</arglist>
			<digest>
				Replace a data element, output data
			</digest>
			<description>
				Same as <m>nsub</m>, except that the message stored at the specified address is sent out after the item has been substituted.
			</description>
		</method>
		<method name="renumber">
			<arglist>
				<arg name="data index" optional="0" type="int" />
			</arglist>
			<digest>
				Renumber entries
			</digest>
			<description>
				Renumbers data entries as consecutive and in increasing order. The optional argument specifies the starting number address for the data.
			</description>
		</method>
		<method name="renumber2">
			<arglist>
				<arg name="data index" optional="0" type="int" />
			</arglist>
			<digest>
				Increment indices by one
			</digest>
			<description>
			</description>
		</method>
		<method name="wclose">
			<arglist />
			<digest>
				Close the data editing window
			</digest>
			<description>
			</description>
		</method>
		<method name="write">
			<arglist>
				<arg name="filename" optional="0" type="symbol" />
			</arglist>
			<digest>
				Write the data to a disk file
			</digest>
			<description>
				With no arguments, <m>write</m> puts up a standard Open Document dialog box to choose a filename to write. If an argument is provided, the name is used as a filename for storage.
			</description>
		</method>
		<method name="writeagain">
			<arglist />
			<digest>
				Rewrite a file
			</digest>
			<description>
				Saves the contents to the most recently written file. If no prior file write has occurred, the request is treated like a <m>write</m> message.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="embed" get="1" set="1" type="int" size="1">
			<digest>
				Set embedding flag
			</digest>
			<description>
				Toggles the ability to embed the contents of the <o>coll</o> as part of the main. This value can only be set using the Save Data with Patcher setting in the Object Inspector. The default behavior is 0 (don't save the data with the patch).
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Save Data With Patcher" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="coll.png" caption="Complex messages can be recalled with a single number or word... Results for successive next and prev messages" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="bag" />
		<seealso name="itable" />
		<seealso name="jit.cellblock" />
		<seealso name="table" />
		<seealso name="funbuff" />
		<seealso name="basicchapter18" module="max" type="tutorial" />
		<seealso name="datachapter03" module="max" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="anything">
			<description>
				Messages stored in <o>coll</o> are sent out the 1st outlet. If the message consists of only a single symbol, it will be preceded by the word <m>symbol</m> when it is sent out.
			</description>
		</entry>
		<entry name="int">
			<description>
				Out 1st outlet: The number of messages contained in <o>coll</o> is sent out in response to the <m>length</m> message.
			</description>
		</entry>
		<entry name="int or symbol">
			<description>
				Out 2nd outlet: The address is sent out whenever a message out the 1st outlet is triggered by <m>bang</m>, <m>dump</m>, <m>next</m>, <m>prev</m>, or <m>sub</m>.
			</description>
		</entry>
		<entry name="bang">
			<description>
				Out 3rd outlet: Sent out when <o>coll</o> has finished reading in a file of data.
				<br />
				<br />
				Out 4th outlet: Sent out when <o>coll</o> has finished sending all of the stored addresses and messages in order out the 1st and 2nd outlets in response to a <m>dump</m> message.
			</description>
		</entry>
	</misc>
</c74object>
