Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <summary>
- /// Gets a previously declared function by name and number of parameters.
- /// </summary>
- private ScriptMemberFunction getFunction(string name, int paramCount)
- {
- ScriptMemberFunction result = null;
- foreach (ScriptMemberFunction func in declaredFunctions)
- {
- if (name == func.FunctionName)
- {
- // AutoIt does not do function overloading
- if (paramCount >= func.MinParams && paramCount <= func.MaxParams)
- {
- result = func;
- }
- else
- {
- throw new AutoItException("Incorrect number of parameters in function call");
- }
- }
- }
- if (result == null)
- {
- throw new AutoItException("Unknown function name.");
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement