Subj : Re: Help translating C To : netscape.public.mozilla.jseng From : "Sterling Bates" Date : Sat Jul 12 2003 05:33 pm Should've clarified the access violation...I get the AV when passing the resulting newjsval to JS_CallFunctionName. "Sterling Bates" wrote in message news:beq1m5$cco1@ripley.netscape.com... > I'm trying to translate the following code to Delphi: > > /* Start */ > #define JSVAL_SETTAG(v,t) ((v) | (t)) > #define STRING_TO_JSVAL(str) JSVAL_SETTAG((jsval)(str), JSVAL_STRING) > > JSString * mystr; > jsval myjsval; > > mystr = JS_NewStringCopyZ("test string"); > myjsval = STRING_TO_JSVAL(mystr); > /* End */ > > This is to let a string be passed through a jsval array to a function call. > The problem is that, relative to mystr, I don't know which byte JSVAL_SETTAG > is modifying with JSVAL_STRING. > > I've tried the following in Delphi, but get an access violation reading > address 0: > > newjsval := jsval(@jsstr); > newjsval := newjsval OR JSVAL_STRING; > > Thanks for any help you can provide, > > Sterling > > .