Examples of narg()


Examples of org.luaj.vm2.Varargs.narg()

        vargs[i] = LuaValue.valueOf(args[i]);
      Varargs cargs = LuaValue.varargsOf(vargs);
      Varargs v = chunk.invoke(cargs);
     
      // print the result
      for ( int i=1; i<=v.narg(); i++ )
        System.out.println("result["+i+"]: "+v.arg(i));
    } catch ( Throwable e ) {
      e.printStackTrace();
      saveClasses();
    }
View Full Code Here

Examples of org.luaj.vm2.Varargs.narg()

      "return bigNumA:toString(), bigNumB:toString(), bigNumC:toString()";
    Varargs chunk = _G.get("loadstring").call(LuaValue.valueOf(script));
    if ( ! chunk.arg1().toboolean() )
      fail( chunk.arg(2).toString() );
    Varargs results = chunk.arg1().invoke();
    int nresults = results.narg();
    String sa = results.tojstring(1);
    String sb = results.tojstring(2);
    String sc = results.tojstring(3);
    assertEquals( 3, nresults );
    assertEquals( "12345678901234567890", sa );
View Full Code Here

Examples of org.luaj.vm2.Varargs.narg()

      "return b,c";
    Varargs chunk = _G.get("loadstring").call(LuaValue.valueOf(script));
    if ( ! chunk.arg1().toboolean() )
      fail( chunk.arg(2).toString() );
    Varargs results = chunk.arg1().invoke();
    int nresults = results.narg();
    assertEquals( 2, nresults );
    LuaValue b = results.arg(1);
    LuaValue c = results.arg(2);
    String sb = b.tojstring();
    String sc = c.tojstring();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.