function rtdemo(x,itemName,serviceName)
%RTDEMO Reuters realtime event callback.
%   RTDEMO(X,ITEMNAME,SERVICENAME) is the Reuters realtime event callback 
%   demonstration function used to return Reuters realtime data from the 
%   RMDS system to the MATLAB workspace.   X is the return data structure, 
%   ITEMNAME is the name of the returned item and SERVICENAME is the 
%   service being used.
%
%   For example, the following commands will connect to Reuters, subscribe
%   to the security ABC.N and display the data in realtime in the MATLAB
%   Variable Editor.
%
%   r = reuters('myNS::remoteSession','dIDN_RDF')
%   d = fetch(r,'ABC.N','rtdemo')
%   openvar('A')
%
%   See also REUTERS

%   Copyright 1999-2011 The MathWorks, Inc.
if ~isempty(itemName)
  x.ItemName = char(itemName);
end
if ~isempty(serviceName)
  x.ServiceName = char(serviceName);
end
assignin('base','A',x)
