Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
redryn
Newbie


Joined: 10 Dec 2010
Posts: 1

PostPosted: 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.)
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: 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.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: 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)))
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: 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.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net