Execute() public méthode

Executes the script.
public Execute ( ) : bool
Résultat bool
		/// <summary>
		/// Executes the given script.
		/// </summary>
		/// <param name="p_strScript">The script code to execute.</param>
		/// <returns><c>true</c> if the script completes successfully;
		/// <c>false</c> otherwise.</returns>
		public bool Execute(string p_strScript)
		{
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);
			Control.CheckForIllegalCrossThreadCalls = false;

			try
			{
				ModScriptInterpreter msiInterpreter = new ModScriptInterpreter(m_msfFunctions, p_strScript);
				return (bool)msiInterpreter.Execute();
			}
			catch (Exception ex)
			{
				StringBuilder stbException = new StringBuilder(ex.ToString());
				while (ex.InnerException != null)
				{
					ex = ex.InnerException;
					stbException.AppendLine().AppendLine().Append(ex.ToString());
				}
				string strMessage = "An exception occured in the script.";
				m_msfFunctions.ExtendedMessageBox(strMessage, "Error", stbException.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error);
				return false;
			}
		}
        /// <summary>
        /// Executes the given script.
        /// </summary>
        /// <param name="p_strScript">The script code to execute.</param>
        /// <returns><c>true</c> if the script completes successfully;
        /// <c>false</c> otherwise.</returns>
        public bool Execute(string p_strScript)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Control.CheckForIllegalCrossThreadCalls = false;

            try
            {
                ModScriptInterpreter msiInterpreter = new ModScriptInterpreter(m_msfFunctions, p_strScript);
                return((bool)msiInterpreter.Execute());
            }
            catch (Exception ex)
            {
                StringBuilder stbException = new StringBuilder(ex.ToString());
                while (ex.InnerException != null)
                {
                    ex = ex.InnerException;
                    stbException.AppendLine().AppendLine().Append(ex.ToString());
                }
                string strMessage = "An exception occured in the script.";
                m_msfFunctions.ExtendedMessageBox(strMessage, "Error", stbException.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
        }