Subj : Returning an object from a function To : netscape.public.mozilla.jseng From : "Frank Schroeder" Date : Thu Mar 11 2004 10:18 pm Hello, Could someone publish some sample code on how to return a newly constructed object back to the script? Something that implements the following: set rs=Server.Open("select * from products"); name=rs.GetData("productname"); etc... I know how to implement the "Server" object and "Open" function, but how do I make "Open" return a new "rs" object in the code below? JSBool Server_Open(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { obj=JS_DefineObject(cx, global, "RecordSet", &js_RecordSet_Class, 0, JSROP_ENUMERATE); if (obj) JS_DefineFunctions(cx, obj, RecordSet_functions); *rval=obj; // ???????????????????? return TRUE; } Thanks. .