Built in Pos function missing default third parameter

The Pos function that is provided by default only allows two parameters. The Delphi documentation has identified three parameters, with the third parameter defaulting to 1:
function Pos(const subStr, Str: UnicodeString; Offset: Integer): Integer;

"The offset argument is optional. Offset is set to 1 by default..."

I need this functionality in my script. For now, I believe I can override the default version.

Yes, you can simply call DefineMethod and register your own version of Pos method.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.