Ad Space — Top Banner

E2035

Delphi Programming Language

Severity: Minor

What Does This Error Mean?

Error E2035 means you called a procedure or function but did not pass all the required parameters. Delphi checks at compile time that every required argument is provided. You need to add the missing arguments to the function call.

Affected Models

  • Delphi 2005 and later
  • RAD Studio
  • Lazarus/Free Pascal (similar error)

Common Causes

  • Forgetting to pass one or more arguments when calling a function
  • Calling a function with an older signature after the function was updated to require more parameters
  • Confusing two similarly-named functions — calling one when you meant to call the other
  • A function that previously had default parameter values had those defaults removed in a refactor
  • Copy-pasting a function call and forgetting to add all arguments for the new context

How to Fix It

  1. Click the error to jump to the line with the function call. Count the arguments you passed and compare to the function's declaration.

    In the Delphi IDE, place your cursor on the function name and press Ctrl+Click to jump to its declaration.

  2. Look at the function's parameter list in its declaration. Each parameter without a default value is required. Add the missing arguments in the correct order.

    Parameters with := in the declaration have default values and are optional. All others are required.

  3. If the function was recently changed to require more parameters, update every place in your code that calls it.

    Use Find in Files (Ctrl+Shift+F) to locate all calls to the function across the project.

  4. If you do not have a value to pass for a required parameter, consider whether the function should have a default value for it, or whether you should redesign the call.

    Add a default value in the declaration: procedure MyProc(AName: string; AValue: Integer = 0); — then AValue becomes optional.

  5. If you are getting this error on a built-in Delphi function, check the documentation for the exact signature. Some functions require more arguments than you expect.

    Press F1 with the cursor on the function name to open the documentation.

When to Call a Professional

E2035 is always something you can fix yourself. Delphi tells you exactly which function is missing parameters. Look at the function's declaration to see which parameters are required.

Frequently Asked Questions

What are default parameter values and how do they help?

Default parameter values let you make some parameters optional. If a caller does not provide a value for that parameter, Delphi uses the default. This is great for functions that usually work with common settings but sometimes need customization. Example: procedure ShowMessage(Msg: string; TimeoutSecs: Integer = 5); — TimeoutSecs is optional.

Can I pass parameters in a different order by using their names?

No — Delphi does not support named parameters in function calls. Arguments must be passed in the exact order they are declared. If you want flexibility, use overloaded functions or a record to hold the parameters.

How do I see the full parameter list for a function in the IDE?

Type the function name followed by an opening parenthesis — the IDE shows a tooltip with the complete parameter list. You can also press Ctrl+Click on the function name to jump to its declaration. Or press F1 to open the documentation for built-in functions.