public static string ExecuteStack(Stack Stack, bool Debug, bool Trace) { try { if (!(Stack.StackObjects.Count == 0)) { string StackResult = null; Stack.InitializeIndexer(); Stack.Index(); Stack.StackIndex = 0; while (Stack.StackIndex < Stack.StackObjects.Count) { StackResult = ExecuteStackObject(Stack.StackObjects[Stack.StackIndex], !Debug).ToString(); if (Stack.StackObjects[Stack.StackIndex].StackObjectCommandType == StackObjectCommandType.EndFunction) return StackResult; Stack.StackIndex++; } } if (Debug) return StackResults.GetCheckResult(Stack); else return StackResults.GetSuccessResult(Stack); } catch (Exception ex) { if ((ex.InnerException != null)) { if (!(ex.InnerException.Message == "STOP")) throw ExceptionManager.HandleException(ex.InnerException, Trace); else if (!Debug) return StackResults.GetStopResult(Stack); } else throw ExceptionManager.HandleException(ex, Trace); } return null; }