plympton;541593 Wrote: 
> Like this? (See attached)
> 
You need to change the function to something like this:

Code:
--------------------
    
  sub macroString {
  my $request = shift;
  my $client = $request->client();
  
  $log->debug("Inside CLI macroString request");
  
  my $macroString = $request->getParam('_p1');
  my $period = $request->getParam('_p2');
  
  #Default period to 0 if not provided
  if (!defined $period) {$period = 0;}
  $log->debug("Incoming string: $macroString Period: $period");
  $macroString = replaceMacrosPer($macroString, $period, $client);
  
  $log->debug("Outgoing string: $macroString");
  $request->addResult( "macroString", $macroString );
  
  $request->setStatusDone();
  }
  
--------------------


$mode removed from log message since it doesn't exist in this function
and changed _p2 to _p1 and also _p3 to _p2.

If you like to avoid the _p* references, you can used tagged parameters
instead and use:

Code:
--------------------
    
  my $macroString = $request->getParam('format');
  my $period = $request->getParam('period');
  
--------------------


And the user will have to specify the parameters as:

Code:
--------------------
    
  sdtMacroString format:Temp%H period:-1
  
--------------------


This makes the function logic a bit less sensitive to which order the
caller passes the parameters.

However, note that if you haven't used tagged parameters before and
starts to use it, all clients using the old interface has to be changed
so they specify the parameter names as shown above.


-- 
erland

Erland Isaksson
'My homepage' (http://erland.isaksson.info) (Install my plugins through
Extension Downloader)
(Developer of 'TrackStat, SQLPlayList, DynamicPlayList, Custom Browse,
Custom Scan,  Custom Skip, Multi Library, Title Switcher and Database
Query plugins'
(http://wiki.erland.isaksson.info/index.php/Category:SlimServer))
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=77864

_______________________________________________
jive mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive

Reply via email to