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 arguments

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



Joined: 04 Aug 2014
Posts: 335

PostPosted: Wed Aug 02, 2017 5:36 pm    Post subject: Function arguments Reply with quote

Hi, the functions seems to remember the arguments passed from a previous run, when you not provide them:

Code:

#function {rnd} {#math {result} {1 d (%2 - %1 + 1) + %1 - 1}}
#OK. FUNCTION {rnd} HAS BEEN SET TO {#math {result} {1 d (%2 - %1 + 1) + %1 - 1}}.
#show {@rnd{100}}
99
#show {@rnd{100}}
99
#show {@rnd{100}}
99
#show {@rnd{100;120}}    <-- Second parameter
110
#show {@rnd{100}}           <-- it remembers !!
116
#show {@rnd{100}}
103


Could be useful to have a way to check if a parameter was passed or not, so to use some default values... by now it's impossible, because them contains always the values from the last run.

Also the #HELP FUNCTION here should be corrected:
Code:

Example: #function {rnd} {#math {result} {1 d (%2 - %1 + 1) + %1 - 1}}
         #showme A random number between 100 and 200: @rnd{100 200}


missing semicolon
Code:

@rnd{100;200}
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3764

PostPosted: Wed Aug 02, 2017 6:33 pm    Post subject: Reply with quote

Thanks, fixed the help file.

I'm not sure if I should fix this, it's not a real bug, more of a quirk, so it would just add more complexity without any real benefits.
Back to top
View user's profile Send private message Send e-mail
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