By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,852 Members | 955 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,852 IT Pros & Developers. It's quick & easy.

Error: missing ) in parenthetical error

P: n/a
Hi,

Trying the following ...

function getCurrentVal(poValue)
{
var lcCurrentVal = 0;
if (isNaN(parseInt(poValue)))
{
var loValue = poValue.toUpperCase();
if (loValue == "/")
{
lcCurrentVal = "/";
}
if (loValue == "X")
(
lcCurrentVal = "X";
{
}
else
{
lcCurrentVal = parseInt(poValue);
}

if(lcCurrentVal)
{
return lcCurrentVal;
}
}
and am getting the error

Error: missing ) in parenthetical
Line: 189, Column: 23
Source Code:
lcCurrentVal = "X";

I can't for the life of me figure it out. If i comment this line out it
works fine (but then that check is removed). Any help would be most
appreciated.

Cheers
Bj McGowan

Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
th*******@gmail.com wrote:
Hi,

Trying the following ...

function getCurrentVal(poValue)
{
var lcCurrentVal = 0;
if (isNaN(parseInt(poValue)))
{
var loValue = poValue.toUpperCase();
if (loValue == "/")
{
lcCurrentVal = "/";
}
if (loValue == "X")
(
lcCurrentVal = "X";
{
}
else
{
lcCurrentVal = parseInt(poValue);
}

if(lcCurrentVal)
{
return lcCurrentVal;
}
}
and am getting the error

Error: missing ) in parenthetical
Line: 189, Column: 23
Source Code:
lcCurrentVal = "X";

I can't for the life of me figure it out. If i comment this line out it works fine (but then that check is removed). Any help would be most
appreciated.

Cheers
Bj McGowan

Hard to see this late in the day, but shouldn't this:
if (loValue == "X")
( <----

....be a curly brace? ;)

Rob

Jul 23 '05 #2

P: n/a
I love you!!

Thanks man.... been staring at this for ages and didn't even see that.
Cheers
Bj

Jul 23 '05 #3

P: n/a
th*******@gmail.com wrote:
Hi,

Trying the following ...

function getCurrentVal(poValue)
{
var lcCurrentVal = 0;
if (isNaN(parseInt(poValue)))
{
var loValue = poValue.toUpperCase();
if (loValue == "/")
{
lcCurrentVal = "/";
}
if (loValue == "X")
(
lcCurrentVal = "X";
{
}
else
{
lcCurrentVal = parseInt(poValue);
}

if(lcCurrentVal)
{
return lcCurrentVal;
}
}
and am getting the error

Error: missing ) in parenthetical
Line: 189, Column: 23
Source Code:
lcCurrentVal = "X";

I can't for the life of me figure it out. If i comment this line out it
works fine (but then that check is removed). Any help would be most
appreciated.


Of course you can't. When code is this ugly, it is impossible to reason
about its correctness. First you should format it properly. Indent the
contents of all of the blocks. If you still can't see the problem, then
run it through JSLINT.

http://www.crockford.com/javascript/lint.html
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.