HI  I am trying to run this code:
    global.currentHangManWord = "a word of any sort";
    var curChar = "";
    curChar = global.currentHangManWord.charAt(pos-1);
within rhino.

I have added the global object via
Object globalObj = cx.newObject(scope);
org.mozilla.javascript.ScriptableObject.putProperty( scope, "global", 
globalObj );

then i call the script code.
Object result = cx.evaluateString(scope, code, "<javascript>", 1, null);

NOTES: cx is a Context object.

PROBLEM :
i keep getting this error
TypeError: Cannot call method "charAt" of undefined (<javascript>#8) 
executing code=


can anyone enlighten me as to what i am doing wrong please?

Kind Regards

Chris Wade


_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to