javascript datatype problem


    Feb 25 2006 | 12:25 am
    hello all,
    Having a problem with js. I've got a function that outputs via:
    outlet(3, "max " + (start+length) );
    now the idea is to have outlet 3 of the js object go to a max num object and set the "max" value that num object can go up to. I get?:
    error: number: doesn't understand "max 3"
    Any ideas of how to get around this?

    • Feb 25 2006 | 2:59 am
      Moving this thread to javascript...
      w
    • Mar 01 2006 | 6:33 pm
      i think you need to send it outlet(3, "max ", (start+length) ); instead. I think using the +, it is output as a symbol? the above format will make it a list that number will understand.
    • Mar 02 2006 | 5:20 pm
      Thanks for the suggestion. But I still get the same error. It almost seems that strings that come out of the js object are not reconized by the num object. Anyone else? Heres the example
      And the js code noset.js:
      inlets =1; outlets = 2;
      function franz(b){ outlet(0, "set " + b); outlet(1, "set ", b); }
    • Mar 02 2006 | 6:05 pm
      This works for outlet 1:
      autowatch = 1;
      inlets = 1; outlets = 2;
      function franz(b) { outlet(0, "set " + b); outlet(1, "set", b); }
      Am 02.03.2006 um 18:20 Uhr schrieb Tyler Nitsch: > inlets =1; > outlets = 2; > > function franz(b){ > outlet(0, "set " + b); > outlet(1, "set ", b); > }
    • Mar 03 2006 | 7:02 am
      Hello,
      Looks like this may be a Windows bug. I can get it to work on a Mac but not my PC. Anythoughts?
    • Mar 03 2006 | 8:48 am
      To make it clearer: let's say b is 666, if you use
      outlet(0, "set " + b);
      The js object will output the message
      "set 666"
      on outlet 0. This is different from
      set 666
      because the first message is a symbol, the second message is a list made of a symbol "set" and the integer 666.
      In order to do what you want you have to use
      outlet(0, "set", b);
      This will work fine on Windows too.
      Note, no space after "set". Because "set " (with a space) will output the message
      "set " 666
      which is made by the symbol "set " which is different from "set" (for example it will not be detected by [route set]) and the integer 666.
      Maurizio.