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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Zhiroc
Adept


Joined: 04 Feb 2005
Posts: 246

PostPosted: Sat Aug 18, 2007 1:08 am   

Module and Window names containing "-" can't be referenced by //
 
Create a global Module or Window with a hyphen ("-") in its name. Then make a variable in it.

Then:
Code:
#SHOW @testvar
This is in Test-Module

#SHOW @//Test-Module/testvar
-Module/testvar

#SHOW @{//Test-Module/testvar}
(parser error popup)

Rename the module, replacing the "-" with some other character, like "_"
Code:
#SHOW @//Test_Module/testvar
This is in Test-Module

#SHOW @{//Test_Module/testvar}
This is in Test-Module
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Sat Aug 18, 2007 4:03 am   
 
The '-' character isn't allowed in identifier names. The parser gets confused by the "minus" operator. You can only use "_" in identifier names. This is true in many other programming languages, so it's better to just get used to not using '-' in names like this.
Reply with quote
Zhiroc
Adept


Joined: 04 Feb 2005
Posts: 246

PostPosted: Sat Aug 18, 2007 4:27 am   
 
I figured, so therefore the UI should not allow you to set the name of a module or window when it contains a "-"
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Sat Aug 18, 2007 5:26 pm   
 
True. It will be lower priority, but I'll see if I can add validation to the editor in the future. Right now everything just uses a normal Windows Edit control, so you can type any characters that you want (including spaces).
Reply with quote
Zhiroc
Adept


Joined: 04 Feb 2005
Posts: 246

PostPosted: Sat Aug 18, 2007 6:04 pm   
 
Another workaround is that @{"//Test-Module/var"} seems to work, of course at the cost of some time...
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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