Show: Object Pascal C++
Display Preferences

E2166 Unnamed arguments must precede named arguments in OLE Automation call (Object Pascal)

From Appmethod Topics
Jump to: navigation, search

Go Up to Error and Warning Messages (Object Pascal) Index

You have attempted to follow named OLE Automation arguments with unnamed arguments.

program Produce;

    ole : variant;

begin ole.dispatch(filename:='FrogEggs', 'Tapioca');

The named argument, 'filename' must follow the unnamed argument in this OLE dispatch.

program Solve;

    ole : variant;

begin ole.dispatch('Tapioca', filename:='FrogEggs');

This solution, reversing the parameters, is the most straightforward but it may not be appropriate for your situation. Another alternative would be to provide the unnamed parameter with a name.

Personal tools
In other languages