【问题标题】:How can I convert record to string in Mozart OZ如何在 Mozart OZ 中将记录转换为字符串
【发布时间】:2012-04-26 15:26:40
【问题描述】:

例如:

local A = aircraft(id:'Avro' size:[2 36] state:state(time:20 status:parked))           
in
  {Browse A}
end

我想将 A 转换为类似浏览窗口的字符串,以便通过管道(序列化)将数据发送到其他程序。

是否存在任何 Mozart 原生函数或任何捷径? 感谢您的想法

【问题讨论】:

    标签: type-conversion oz mozart


    【解决方案1】:

    看看库函数Value.toVirtualString(docs)。对于DepthIWidthI,如果您不想限制输出,您只需选择一些较大的整数值。

    要确保结果是字符串(不是虚拟字符串),请使用VirtualString.toString

    【讨论】:

      猜你喜欢
      • 2015-05-13
      • 2010-12-15
      • 2011-07-07
      • 2021-12-04
      • 1970-01-01
      • 2011-06-07
      • 1970-01-01
      • 1970-01-01
      • 2017-05-12
      相关资源
      最近更新 更多