delete a named object


    Oct 24 2006 | 12:42 pm
    hi and thanks all,
    I'm trying to delete object with name with js. Maybe is a basic question but I'm not able to solve it?
    There's a working code
    autowatch = 1;
    var p = this.patcher;
    function del () { a = p.getnamed ("number_1"); p.remove(a); }
    But I constrained to a constant, of course.
    And there's a crashing code:
    autowatch = 1;
    var p = this.patcher;
    function del (name) { a = p.getnamed ("name"); p.remove(a); }
    And how can I avoid crashing if I recall a just delated object?
    Suggestions?
    Many thanks
    Matteo
    --------------------------js--------------------------------- prove.js
    autowatch = 1;
    var p = this.patcher;
    function del () { a = p.getnamed ("number_1"); p.remove(a); }
    --------------------- prove_crash.js autowatch = 1;
    var p = this.patcher;
    function del (name) { a = p.getnamed ("name"); p.remove(a); }
    --------------------------patcher_example---------------------------------

    • Oct 24 2006 | 7:23 pm
      Forgotten: maxmsp 4.6.2 jitter 1.6.2 osx 10.4.8 PPc powerbook 1 GH 1G ram
      matteo