coll
Store and edit a collection of data
Description
Allows for the storage, organization, editing, and retrieval of different messages.
Arguments
name[symbol]
optional
no-search[any]
optional
An optional nonzero value as a second argument will prevent the coll object from searching for a file with the named symbol.
Attributes
embed[int]
When embed is enabled, data in the coll is saved with its patcher. By default embed is not enabled. If embed is enabled with a typed-in argument ( ), it cannot be turned off in the inspector.
name[symbol]
The name of the coll. Multiple objects with the same name will share the same data. You can also share data using the message.
precision[int]
The number of decimal places for converted floating point values (default = 6).
Common Box Attributes
annotation[symbol]
Sets the text that will be displayed in the Clue window when the user moves the mouse over the object.
background[int]: 0
Adds or removes the object from the patcher's background layer.
adds the object to the background layer, removes it. Objects in the background layer are shown behind all objects in the default foreground layer.
color[4 floats]
Sets the color for the object box outline.
fontface[int]
Sets the type style used by the object. The options are:
plain
bold
italic
bold italic
Possible values:
0 = 'regular'
1 = 'bold'
2 = 'italic'
3 = 'bold italic'
fontname[symbol]
Sets the object's font.
fontsize[float]
Sets the object's font size (in points).
Possible values:
'8'
'9'
'10'
'11'
'12'
'13'
'14'
'16'
'18'
'20'
'24'
'30'
'36'
'48'
'64'
'72'
hint[symbol]
Sets the text that will be displayed in as a pop-up hint when the user moves the mouse over the object in a locked patcher.
ignoreclick[int]: 0
Toggles whether an object ignores mouse clicks in a locked patcher.
jspainterfile[symbol]
You can override the default appearance of a user interface object by assigning a JavaScript file with code for painting the object. The file must be in the search path.
patching_rect[4 floats]: 0. 0. 100. 0.
Sets the position and size of the object in the patcher window.
position[2 floats]
write-only
Sets the object's x and y position in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its size unchanged.
presentation[int]: 0
Sets whether an object belongs to the patcher's presentation.
presentation_rect[4 floats]: 0. 0. 0. 0.
Sets the x and y position and width and height of the object in the patcher's presentation, leaving its patching position unchanged.
rect[4 floats]
write-only
Sets the x and y position and width and height of the object in both patching and presentation modes (if the object belongs to its patcher's presentation).
size[2 floats]
write-only
Sets the object's width and height in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its position unchanged.
textcolor[4 floats]
Sets the color for the object's text in RGBA format.
textjustification[int]
Sets the justification for the object's text.
Possible values:
0 = 'left'
1 = 'center'
2 = 'right'
varname[symbol]
Sets the patcher's scripting name, which can be used to address the object by name in pattr, scripting messages to thispatcher, and the js object.
Messages
bang
See the
listing.
int
The number refers to the address of a message stored in coll. If a message is stored at that address, the stored message is output. If the stored message is a single symbol, it is always prepended with the word "symbol" when output.
- index
[int]
float
The number refers to the address of a message stored in coll. If a message is stored at that address, the stored message is output. If the stored message is a single symbol, it is always prepended with the word "symbol" when output.
- index
[float]
list
The first value is used as the address (the storage location within coll) at which to store the remaining items in the list. The address will always be stored as an int.
- index
[int]
- data
[list]
anything
See the
listing.- index
[any]
append
The coll is empty, will add an item associated with the index 0. a second time will add another item associated with the index 1.
message creates a new item associated with an index that is one larger than the highest current index. For example, if the- data
[list]
assoc
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.
- address name
[symbol]
- data index
[int]
clear
Clear all data
(mouse)
Double-click on the coll object to display the contents as text in an editing window. The data can be manually edited within this editor.
deassoc
Removes the association between a symbol and the number address. The symbol will no longer have any meaning to coll.
- address name
[symbol]
- data index
[int]
delete
Removes the data at the address provided. If the specified address is numeric, all higher numbered addresses are decremented by 1.
- index
[any]
dump
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
is sent out the 4th outlet when the dump is completed.
end
Sets the pointer (as used by the
, , and messages) to the last address.
filetype
Sets the file types which can be read and written into the coll object. The message with no arguments restores the default file behavior.
- filetype
[symbol]
flags
Sets the flags used to save its contents within the patch that contains it. The message
notifies the object to save its contents as part of the patcher file. The message causes the contents not to be saved.- save-setting
[int]
- unused
[int]
goto
Sets the pointer (as used by the
, , and 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 , , or message.- index
[list]
insert
Inserts the message at the address specified by the number, incrementing all equal or greater addresses by 1 if necessary.
- index
[int]
- data
[list]
insert2
See the
listing.- index
[int]
- data
[list]
length
Counts the number of entries contained in the coll and sends the number out the 1st outlet.
max
Gets the highest value in any entry. An optional integer argument (defaults to '1') specifies an element position to use.
- element
[int]
merge
Appends data at the end of the data found at the specified index. If the address does not yet exist, it is created.
- index
[int]
- data
[list]
min
Gets the lowest value in any entry. An optional integer argument (defaults to '1') specifies an element position to use.
- element
[int]
next
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,
is sent out the second outlet.
nstore
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
message to associate a symbol with that number.- index
[int]
- association
[symbol]
- data
[list]
nsub
Replaces a data element with a new value. As an example,
replaces the fourth element of address 2 with the value 7. Number values and symbols can both be substituted in this manner.- index
[int]
- position
[int]
- data
[any]
nth
Returns the data element found at a specific position in the stored list and send it out the first outlet. As an example,
will output the second item in the list stored at address 75.- index
[int]
- position
[int]
open
Opens a data editing window for the current data and bring it into focus.
prev
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,
is sent out the second outlet.
read
With no arguments,
puts up a standard Open Document dialog box to choose a file to load. If an argument is provided, the named file is loaded.- filename
[symbol]
readagain
Loads the contents of the most recently read file. If no prior file load has occurred, the request is treated like a
message.
refer
remove
Removes that address and its contents from the collection.
- index
[any]
renumber
Renumbers data entries as consecutive and in increasing order. The optional argument specifies the starting number address for the data.
- data index
[int]
renumber2
Increment indices by one
- data index
[int]
separate
Increments the numerical indices for all data whose index is greater than the provided. This creates an open 'slot' for a subsequent add.
- data index
[int]
sort
Sorts the data into a specified order. If the first argument is
The second argument specifies what data is used to sort the contents. If the second argument is , the index (either number or symbol) associated with the data is used. If the second argument is not present or is , the first item in the data is used. If the second argument is or greater, that data elements is used for the sorting order.
- sort order (-1 or 1)
[int]
- entry (-1, 0, or 1)
[int]
start
Sets the pointer (used by the coll.
, , and messages) to the first address in the
store
Stores the message at an address named by the provided symbol. As an example,
will store at an address named .- index
[symbol]
- data
[list]
sub
Same as
, except that the message stored at the specified address is sent out after the item has been substituted.- index
[int]
- position
[int]
- data
[list]
subsym
Changes the symbol associated with data. The first argument is the new symbol to use, the second argument is the symbol associator to replace.
- new name
[symbol]
- old name
[symbol]
swap
Exchanges the indices associated with two addresses. The data is unchanged, but the indexes that they use are swapped.
- index
[int]
- index
[int]
symbol
Retrieves a message stored at the address named by the symbol. If no address is associated with the symbol, no output is produced. If the stored message is a single symbol, it is always prepended with the word "symbol" when output.
- index
[symbol]
wclose
Close the data editing window
write
With no arguments,
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.- filename
[symbol]
writeagain
Saves the contents to the most recently written file. If no prior file write has occurred, the request is treated like a
message.Output
anything
Messages stored in coll are sent out the 1st outlet. If the message consists of only a single symbol, it will be preceded by the word when it is sent out.
bang
int
Out 1st outlet: The number of messages contained in coll is sent out in response to the message.
int or symbol
Out 2nd outlet: The address is sent out whenever a message out the 1st outlet is triggered by
, , , , or .See Also
Name | Description |
---|---|
External Text Editor | External Text Editor |
bag | Store a collection of numbers |
itable | Data table editor |
jit.cellblock | Edit rows and columns of data |
table | Store and edit an array of numbers |
funbuff | Store pairs of numbers |
coll.codebox | Store and edit a collection of data |