You are not logged in.
My understanding is that Pascal can support optional parameters, in the form:
function FilterFile(S: WideString; isEnabled: Boolean = True): WideString;
In ReNamer, I get a compiler error (semicolon expected). Can someone confirm whether or not optional parameters are supported by ReNamer's PascalScript rules?
Thanks
Offline
Pascal language does support optional parameters, but unfortunately the PascalScript engine does not.
This might change in the future.
Offline
Good to know; thanks for the heads up!
Offline
Pascal language does support optional parameters, but unfortunately the PascalScript engine does not.
This might change in the future.
I hope it does change at some point.
Offline
I hope it does change at some point.
We all do, but I wouldn't hold your breath while waiting for it.
Not having optional parameters is just a minor inconvenience, not a show stopper. You can always have slightly different names for functions which take fewer arguments and assume default values.
For example:
function IncrementBy(X: Integer; Y: Integer): Integer;
begin
Result := X + Y;
end;
function Increment(X: Integer): Integer;
begin
Result := IncrementBy(X, 1); // Default of 1 is assumed
end;
Offline