Subj : Re: Stuck on the basics - HELP! To : netscape.public.mozilla.jseng From : "Stu" Date : Thu May 22 2003 04:56 pm "Georg Maaß" wrote in message news:baimul$2tt$3@ID-3551.news.dfncis.de... > Stu wrote: > > >>Hello(){return 'hello';} > >> > >>This should work as desired. > >> > > > > yes is does its just wrapped over the line. I've just verified anyway by > > changing the code to > Hello(){return 'hello';} but that gives the same > > return 'undefined' > > > > Any other ideas, could it be the way I'm reading back the return value? > > Did you call Hello? > the line that calls Hello is: functionptr = JS_CompileFunction(cx, glob, "Hello()", 0, &argnames, functionscript, strlen(functionscript), "default.pac", lineno); rval =0; executed = JS_CallFunction(cx, glob, functionptr, 0, jsargv, &rval); I thought that is how it was called, its compiled with the Function name "Hello()" linked to the functionptr and then using JS_CallFunction on the same functionptr would call the function. Or do I need to used CallFunctionName rather than call function, but that seems pointless as i'd be passing parameters and names twice. once on compile and once on the Call. thanks Stu .