Andy I found this from Chris Kempster at SQLservercentral.
CREATE procedure GenRestoreDatabaseScript_sp @p_dbname varchar(50), @p_datetime datetime, @p_usefullbackupend datetime, @p_stats varchar(20) = 10, @p_stopat datetime = null as
SET NOCOUNT ON
--
--...