initialize Jsvar from string ??

Posted on
  • Its driving me crazy, why is this not working ?

    void myTest(){
      JsVar *r = jsvNewFromString("hugo");
      jsWarn("type:%t\n",r);
      jsWarn("r:%v\n",r);
      jsWarn("json:%j\n",r);
    }
    

    I get this
    WARNING: type:undefined
    WARNING: r:
    WARNING: json:undefined

  • That should work fine. When/where are you calling it? Is it possible you are calling it before the JsVars have been initialised, so it's unable to allocate anything?

  • Yes, thats the point, thanks a lot.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

initialize Jsvar from string ??

Posted by Avatar for JumJum @JumJum

Actions