1

I want to specify

LinkControlToDate.CustomFormat := 'IfThen(%s=0, '''', FormatDateTime(''ddddd'', %s))'

for the property CustomFormat of a TLinkControlToField to handle 0 date values.

But this yields a EConvertError

'no argument for format 'IfThen(%s=0, '', FormatDateTime''

Is it not possible to use a function inside a function with CustomFormat?

Alois Heimer
  • 1,772
  • 1
  • 18
  • 40

1 Answers1

2

You use the parameter %s twice, but there is only one parameter.

Try

LinkControlToDate.CustomFormat := 'IfThen(%s=0, '''', FormatDateTime(''ddddd'', %:0s))'

Use an index specifier for the second %s.

Alois Heimer
  • 1,772
  • 1
  • 18
  • 40
Bimmer
  • 46
  • 4