Subj : Get, Put methods of the Scriptable interface To : netscape.public.mozilla.jseng From : cyberlync@yahoo.com (Eric Merritt) Date : Sun Aug 31 2003 04:07 pm Hello all, Thanks to everyones help (Igors in particular) I am moving right along with my embedding project. However, I have run into another conundrum that I would like some advice about. I am current wrappering up JDBC support for the embedded scripts. For the most part, this is pretty simple. However, when I got to the rowset object I ran into some problems. I would love for data to be accessed in the rowset as it is in a javascript array. For example, say we had a row with the following fields: 'username', 'md5pass', 'timestamp'. You could script it as follows. var database = new Database('somejndicontext'); var rows = database.query('select * from sometable'); rows.nextRow() rows["username"] = "AName"; rows["md5pass"] = "HAHA"; rows.save(); //or rows[0] = "AName"; rows[1] = "HAHA"; rows.save(); The above is pretty simple to do with the 'get' and 'put' methods that you must implement for Scriptable. However, it seams that you must also return methods from get as well as properties. This isn't really to big a deal using the string index, it gets more interesint for the int index however. If you allow the int index how do the indexes map to properties/functions. If you have twenty available methods do the properties start at 21 or would it be the other way around. If the first case is true then you would use couldnt do row[0] = "AName"; you would have to do row[21] = "AName";. This would be a bit counter intuative to the users. Either way the implementation itself is pretty simple, I am just looking for a bit of advice from you guys who are more experienced in rhino and javascript. .