Subj : variables and scopes To : netscape.public.mozilla.jseng From : Stuart Date : Wed Sep 22 2004 09:05 pm Hi, Thanks to everybodies help answering my previous questions I have finally got to the point were I am testing my code. It has gone great apart from a problem I just bumped into: Unfortunately I don't have a code snipped to easily demontrate the problem so I'll have to do my best to explain--> I have an application scope, a document scope and an anonymous scope (anonymous prototype is the document and the document prototype is the application). On the application scope I ran (note I did not use: var rootCounter = 8): context.evaluateString(appScope, "rootCounter = 8", "test", 1, null); Then from the anonymous scope I run: context.evaluateString(anonScope, "rootCounter = rootCounter + 1", "test", 1, null); Then from the anonymous scope I get the value of: [Note: to get the value I used Object resultObject = ecmaContext.evaluateString(anonScope, "rootCounter", "test", 1, null); resultString = ecmaContext.toString(resultObject);] rootCounter (this comes out as 9) -and- application.rootCounter (this comes out as 8) Why would rootCounter and application.rootCounter have different values? Are they not the same? There is alot of other stuff going on in my program so it may be something else that I am doing...but if you have any ideas please let me know. Thanks alot, Stuart .