THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 30/09/2011 at 12:13, xxxxxxxx wrote:
User Information:
Cinema 4D Version: any
Platform:
Language(s) : C.O.F.F.E.E ;
---------
Hello,
missing a class for a dynamic set of data in COFFEE ? Like Python lists for example ?
The clList class is exactly what you search for. Append items, remove items, pop 'em out !
The code is Open Source and the methods have a short description. You may use the code in private and commercial projects.
An example of how to use the class:
**include** "clList.coh"_// note that it doesn't work in the Script Manager. ;)
_
**main** (doc, op) {
op = doc->GetFirstObject();
var list = new(clList, NULL);
list->message_errors = FALSE;
while (op) {
list->append(op);
op = op->GetNext();
}
println(list->getLength());
try {
list->pop2(3);
}
catch (ExOutOfRange) {
println("I expected minimum 4 objects on the hierarchies top level.");
}
try {
list->remove(doc->GetActiveObject());
}
catch (ExNotAMember) {
println("Seems like there is no object in the scene.");
}
println(list->getLength());
}
Download: clList10.zip
Post bugs here
Cheers,
Niklas