TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

#function $result

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
sooeh



Joined: 20 Nov 2010
Posts: 3

PostPosted: Sat Nov 20, 2010 7:26 pm    Post subject: #function $result Reply with quote

Kind of a request... sort of a bug, depending on how you look at it.

if you use an action, such as the following:

#act {^something} {@function{arg;arg;...}}

This will always send extra output to the mud, when using #return to break out of a command string in the function.

This is because it seems the behavior of #function #return is to always return $result, regardless of it's contents... Even though #return <var> has not been specified.

I wonder if it would be possible to change this behavior, at least so that the default is to do nothing, #nop... not sure

Cheers.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Sat Nov 20, 2010 11:18 pm    Post subject: Reply with quote

Why not use an alias? It's basically a function that doesn't return a result.

You can't separate arguments with semicolons, but it's possible to encapsulate them in braces, for example: somealias {arg1} {arg2} {arg3}
Back to top
View user's profile Send private message Send e-mail
sooeh



Joined: 20 Nov 2010
Posts: 3

PostPosted: Sat Nov 20, 2010 11:56 pm    Post subject: #act / #func Reply with quote

Scandum wrote:
Why not use an alias? It's basically a function that doesn't return a result.

You can't separate arguments with semicolons, but it's possible to encapsulate them in braces, for example: somealias {arg1} {arg2} {arg3}


No technical reason why not... I just like @func{arg;arg;...} for readability and cleanliness.



Was also interested in whether or not this was expected behavior between #act and #function?

As you said, however, this is easily remedied by using an alias, or simply using a '#return #nop'
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Sun Nov 21, 2010 10:38 am    Post subject: Reply with quote

It's expected behavior as the body of an action is processed as input, with an empty string being assumed to be an enter.

#return can be used in an alias as well.

One option to create more function like aliases is as following:

Code:

#alias {somealias(%*,%*)}
{
    #showme arg1(%1);
    #showme arg2(%2)
}

#action {^Something} {somealias(%1,%2)}
Back to top
View user's profile Send private message Send e-mail
sooeh



Joined: 20 Nov 2010
Posts: 3

PostPosted: Sun Nov 21, 2010 2:58 pm    Post subject: Reply with quote

I appreciate the time you've spent answering my questions. I Also appreciate the work you are doing to keep this bad-boy moving forward.

Cheers.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports All times are GMT - 5 Hours
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
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group