|
redryn Newbie
Joined: 10 Dec 2010 Posts: 1
|
Posted: Fri Dec 10, 2010 7:33 am
[Q] Unmatched parenthesis error |
I'm getting an unmatched parenthesis error on this line:
Any idea why? I've triple counted them and they definitely match up. No issue with the rest of the script, because i can paste this line into a new blank alias and get the same error.
#SHOW %if( @sqlmobsearchtemp.Item("mob_name")!=%null, %ansi( grey)Name~: %ansi( white) %format("&-25s", @sqlmobsearchtemp.Item("mob_name")))
(The red ones are not matched. the others are as will be highlighted if i click on them in the syntax editor.) |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Fri Dec 10, 2010 9:42 am |
Try making use of %concat maybe?
Wouldn't it be cleaner to do:
#IF (@sqlmobsearchtemp.Item("mob_name")) {#SHOW {%ansi( grey)Name~: %ansi( white) %format("&-25s", @sqlmobsearchtemp.Item("mob_name"))}}
Sometimes it gets confused on long indexed variables... perhaps try: @{sqlmobsearchtemp.Item("mob_name")} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Dec 10, 2010 3:41 pm |
Redryn, show us the entire script. Most likely the problem is due to something before this line which was not closed off properly.
|
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Fri Dec 10, 2010 5:31 pm |
Actually, seems to be some sort of bug because there should be no reason for the ) at the end of "mob_name" to not close out the Item(. Suggested to take this route instead:
Code: |
$Mob_name=@sqlmobsearchtemp.Item("mob_name")
#SHOW %if($Mob_name, %concat( %ansi( grey), "Name: ", %ansi( white), " ",%format( "&-25s", $Mob_name))) |
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Dec 10, 2010 6:35 pm |
No, I've seen exactly this error come up because of an unclosed expression earlier in the script. We need to see the script.
|
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Fri Dec 10, 2010 7:30 pm |
As right as you may be, he changed it to the above (he's currently banned from updating posts for some reason), and it worked perfectly.
Furthermore, if you put just that expression (his original) in a blank setting (create a new alias, for instance), you'll see it has nothing to do with anything other than that particular line. It's treating the closing ) for Item as a string instead of a closing ). Try it out and you'll see what I mean. |
|
|
|
|
|