...

View Full Version : missing } in compound statement ?



BubikolRamios
09-23-2006, 11:53 AM
what is that I don't see in the following function ? Where is } missing ? Thanks for help.


function test11()
{
var success = "false";
var done = "false";

while (success != "true")
{
try
{
member.memberSignIn();
success = "true";
}
catch(err)
{
if (done != "true")
{
memberGetJavaScript();
done = "true";
{
}
}

}

liorean
09-23-2006, 12:31 PM
Have you tried prettyprinting that? The error becomes apparent if you do:
function test11(){
var
success=false,
done=false;
while(!success){
try{
member.memberSignIn();
success=true;
}catch(err){
if(!done){
memberGetJavaScript();
done=true;
{}
}
}
In other words, you've turned one closing brace into an opening brace, thus creating the block marked red here.


Also why do you use 'true'/'false' strings instead of real booleans?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum