【问题标题】:Is it possible to use stacked expressions / to specify more than one parameter for `CustomFormat` in Delphi LiveBindings?是否可以使用堆叠表达式/为 Delphi LiveBindings 中的“CustomFormat”指定多个参数?
【发布时间】:2016-01-03 17:24:59
【问题描述】:

我要指定

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

TLinkControlToField 的属性CustomFormat 处理0 个日期值。

但这会产生EConvertError

''IfThen(%s=0, '', FormatDateTime''格式没有参数

CustomFormat不能在函数内部使用函数吗?

【问题讨论】:

    标签: delphi delphi-xe4 livebindings


    【解决方案1】:

    你使用了参数%s两次,但只有一个参数。

    试试

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

    对第二个%s 使用索引说明符。

    【讨论】:

      猜你喜欢
      • 2017-07-04
      • 1970-01-01
      • 1970-01-01
      • 2016-04-07
      • 2012-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多