error('This command must be followed by TO and DO keywords (in that order).')
error('This command must be followed by TO and DO keywords (in that order).')
end
end
to_id=strmatch('to',varargin);
to_id=strmatch('to',lvarargin);
do_id=strmatch('do',varargin);
do_id=strmatch('do',lvarargin);
ifdo_id<to_id
ifdo_id<to_id
error(sprintf('Wrong syntax! The TO keyword must preceed the DO keyword.\nThe correct syntax is:\n\n from d1 to d2 do SOMETHING\n\n where d1<d2 are dates objects, and SOMETHING is a recursive expression involving dseries objects.'))
error(sprintf('Wrong syntax! The TO keyword must preceed the DO keyword.\nThe correct syntax is:\n\n from d1 to d2 do SOMETHING\n\n where d1<d2 are dates objects, and SOMETHING is a recursive expression involving dseries objects.'))