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
alluran
Adept


Joined: 14 Sep 2005
Posts: 223
Location: Sydney, Australia

PostPosted: Mon Feb 04, 2008 12:52 pm   

[Bug 2.18] Bug with parameters?
 
In An Event Called Report, named params "Script, Period, Channel"
Code:

//Check That We're Meant To Be Reporting
#if (%lower($Script) == "questtracker")
{
  //Declare Variable To Pick DataSource
  #local Timeframe
  //Override Special Keywords
  $Timeframe = %if(%lower($Period)=="all", "", %if(%lower($Period)=="ever", "", $Period))
  //Set Default Channel
  #noop %len($Channel)
  $Channel = %eval(%if(%len($Channel) != 0, $Channel, %db(@qTrackerData, "Default Channel")))
  //Initialize Temp Variable
  #say $Channel $Period
}


#raiseevent "questtracker" "today" "gt"

if i remove the #noop line then channel is incorrectly set to the default channel key in the qTrackerData variable
the #noop line fixes the bug
_________________
The Drake Forestseer
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Feb 04, 2008 7:29 pm   
 
I assume you mean:
#raiseevent report "questtracker" "today" "gt"

rather than:
#raiseevent "questtracker" "today" "gt"

Perhaps I'm missing something. You don't use %eval when setting $Timeframe. Why do you need it to set $Channel?

This is a really odd bug. I have reduced your code to a minimum that shows the bug:
#if (1)
{
#local $TimeFrame
$Channel = %if(%len($Channel) != 0, $Channel, "Default Channel")
#say $Channel
}

If you take out either the #if (1), or the #local, the bug disappears. I've tested this in both an event an an alias.
Reply with quote
alluran
Adept


Joined: 14 Sep 2005
Posts: 223
Location: Sydney, Australia

PostPosted: Mon Feb 04, 2008 11:01 pm   
 
I think i put the eval in just to see if it would fix it. Needless to say, this is a wierd bug, and I was just trying things to find a workaround.
_________________
The Drake Forestseer
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