【问题标题】:Delphi 10.4.2 FMX How to put address in String into TCivicAddress?Delphi 10.4.2 FMX 如何将字符串中的地址放入 TcivicAddress?
【发布时间】:2022-01-20 05:43:16
【问题描述】:

初始化TCivicAddress并将地址信息放入其中的方法是什么?我什至尝试单独设置所有内容,它仍然遇到错误。

var cAddr: TCivicAddress;
cAddr.FeatureName := '10';
cAddr.Thoroughfare := 'Xxxxx Xxxxx Xxx';
cAddr.SubLocality := 'Xxxxxx Xxxxx Xxx';
cAddr.PostalCode := '12345';
cAddr.Locality := 'Xxxxxx';
cAddr.AdminArea := 'Xxxxxxx';
cAddr.CountryName := 'Xxxxxxx';

不能从字符串创建TCivicAddress 吗?我似乎无法在线找到文档。

【问题讨论】:

    标签: delphi firemonkey delphi-10.4-sydney


    【解决方案1】:

    TCivicAddress 是一个在访问任何成员之前需要实例化的类。

    cAddr := TCivicAddress.Create;
    cAddr.FeatureName := '10';
    

    【讨论】:

    • 是否可以一次将整个地址放入字符串中?
    • 我不这么认为。但是如果你有很多这样的转换,你可以从 TcivicAddress 派生你自己的类并添加一个 FromString 函数来完成这项工作。
    猜你喜欢
    • 2022-06-30
    • 1970-01-01
    • 2021-06-23
    • 1970-01-01
    • 2016-09-21
    • 2019-04-11
    • 2019-07-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多