Subj : Re: evaluating a script in C++ Windows application To : netscape.public.mozilla.jseng From : Béatrice Philippe Date : Tue Jan 18 2005 09:56 am yes. writing a function would be the best solution for my need. I'll try 'JS_Compile' and 'JS_CallFunction' from the js_api. Thank you for your help ! -- Béatrice Philippe-Derbez Société Urbilog 80, rue d'Iéna - 59000 Lille 01-69-88-08-11 06-77-92-88-51 beatrice.derbez.bd@wanadoo.fr "Shanti Rao" a écrit dans le message de news:cshg8p$r7l2@ripley.netscape.com... > > Hi everybody and happy new year ! > > > > here is my question about c++ and javascript: > > > > when i create a script with the 'return;' statement, > > compilation fails in my C++ application. > > here is the following script : > > .... > > char *aScript = "var i = '.com'; var j = 'http://www.google.'+i; return;"; > > JSScript *my_jsScript = JS_CompileScript(.....,aScript,....); > > if (!my_Script) { > > my app goes here > > } > > > > if don't insert any 'return;' statement but 'j.toString()' : compilation > > and execute are ok. > > but i need to insert a 'return;' statement. > > > > I think you're wanting something like > > function main() > { > var i = '.com'; > var j = 'http://www.google.'+i; > return; > } > > main() .