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
rdiniz
Newbie


Joined: 21 Jan 2017
Posts: 2

PostPosted: Sat Jan 21, 2017 12:59 am   

#EXEC on function sending an extra carriage return
 
Hello all,
I have a function that when called by a trigger, color the line of the mud, pretty simple.

For that, I'm doing this on the function:

#EXEC #COLOR "hi,green"

The line does get colored as I want, but the problem a blank line is sent to the mud as well, and I don't want that. How can I avoid it?

Thank you.
Reply with quote
shalimar
GURU


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

PostPosted: Sat Jan 21, 2017 2:04 pm   
 
There is no reason to use #EXEC in that instance, i suspect that to be the issue.
_________________
Discord: Shalimarwildcat
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Jan 21, 2017 6:01 pm   
 
The blank line might be caused by how you are calling the function. An alias would likely be a better solution for what you are doing, but that does not make using a function wrong. If you have the function call by itself on a line then CMud will send the results of the function to the mud, in this case a null result. The right way to use a function without sending anything anywhere is with the #CALL command.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
rdiniz
Newbie


Joined: 21 Jan 2017
Posts: 2

PostPosted: Sat Jan 21, 2017 11:59 pm   
 
Thank you Vijilante, using the same logic on an alias worked like a charm for what I wanted

Shalimar, the effect without #EXEC was the same, probably by the cause Vijilante posted after. Thank you too.
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