Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need a 2nd set of eyes

Status
Not open for further replies.

octipuss

Technical User
Aug 6, 2002
4
US
I keep getting an error message with the following code that states that I'm missing a parens but I can't for the life of me see where it's at.

Any help and suggestions would be greatly appreciated.

Thanks in advance.

O~

Here's a condensed version of the error message:
Error: missing ) after argument list
Source Code: var ala =check24(((gmt + (24-9)) > 24) + ((gmt + (24-9)) - 24) : (gmt + (24-9)));

And here's the portion of code in question.
function GetTime()
{
var d8t = new Date();
var def = d8t.getTimezoneOffset()/60;
var gmt = (d8t.getHours() + def);
// may need to use eval for next statement but should work per special operators section on document.clock.local.value = IfZero(d8t.getHours()) + ":" + IfZero(d8t.getMinutes()) + ":" + IfZero(d8t.getSeconds());
var ending = ":" + IfZero(d8t.getMinutes()) + ":" + IfZero(d8t.getSeconds());

var _GMT =check24(((gmt) > 24) ? ((gmt) - 24) : (gmt));

document.clock._GMT.value = IfZero(_GMT) + ":" + IfZero(d8t.getMinutes()) + ":" + IfZero(d8t.getSeconds());
var ala =check24(((gmt + (24-9)) > 24) + ((gmt + (24-9)) - 24) : (gmt + (24-9))); //This line keeps returning an error that a ")" is missing but I can't find it.
document.clock.alaska.value = IfZero(ala) + ending;
var pacif =check24(((gmt + (24-8)) >= 24) ? ((gmt + (24-8)) - 24) : (gmt + (24-8)));
document.clock.pacif.value = IfZero(pacif) + ending;
var east =check24(((gmt + (24-5)) > 24) ? ((gmt + (24-5)) - 24) : (gmt + (24-5)));
document.clock.east.value = IfZero(east) + ending;
var tky =check24(((gmt + 9) > 24) ? ((gmt + 9) - 24) : (gmt + 9));
document.clock.tky.value = IfZero(tky) + ending;
setTimeout("GetTime()", 1000);
} // end GetTime function
 
Is the IfZero function something that only works in Netscape? Or did you write it? Can you provide it for debugging? -- What did you expect? This is FREE advice. LOL[ponder]
 
I couldn't see it either. Errors like this do not necessarily mean that the error exists at the line the error message alerts you to. You could have a paren mismatch in a function above this one! I have this problem now and then and I start by isolating the function first. If no error, than I start looking at the script above it.

There's always a better way...
 
Thanks to both of you. I checked my script in the previous functions and of course everything "seems" good but I'll keep working on it. :>

Thanks again,
 
Change this
var ala =check24(((gmt + (24-9)) > 24) + ((gmt + (24-9)) - 24) : (gmt + (24-9)));

to this
var ala =check24(((gmt + (24-9)) > 24) ? ((gmt + (24-9)) - 24) : (gmt + (24-9))); Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top