Difference between revisions of "Zh/Documentation/DevGuide/ProUNO/Bridge/Mapping of Hyper and Decimal"

From Apache OpenOffice Wiki
Jump to: navigation, search
(New page: {{Documentation/DevGuide/ProUNOTOC/Zh |ProUNO2c=block |ABridgeSvcMgr=block |ABridgeTM=block |ABridgeDM=block |ShowPrevNext=block |PrevPage=Zh/Documentation/DevGuide/ProUNO/Bridge/Mapping o...)
 
m
 
Line 8: Line 8:
 
|NextPage=Zh/Documentation/DevGuide/ProUNO/Bridge/Mapping of String
 
|NextPage=Zh/Documentation/DevGuide/ProUNO/Bridge/Mapping of String
 
}}
 
}}
[[en:Documentation/DevGuide/ProUNO/Bridge/Mapping of Hyper and Decimal]]
+
{{Documentation/DevGuideLanguages|Documentation/DevGuide/ProUNO/Bridge/{{SUBPAGENAME}}}}
 
{{DISPLAYTITLE:hyper 和 Decimal 的映射}}
 
{{DISPLAYTITLE:hyper 和 Decimal 的映射}}
  

Latest revision as of 03:06, 14 May 2009



与 UNO hyper 相比,Automation 不具有 8 字节整数值。但是,Automation 类型 Decimal 值的空间很大,足以表示 hyper。因此,当从 Automation 调用 UNO 方法时,只要 UNO 方法需要 hyper 或 unsigned hyper,就需要使用 Decimal。


并非所有使用 Automation 的语言都支持 Decimal 类型。例如,JScript 和 VBScript,调用这些 UNO 方法时就不应该使用这种类型。这是因为所提供的值可能被四舍五入,因此结果将会受到影响。


Visual Basic 限制只能将 Decimal 变量声明为 Variant。因此必须使用 CDec 函数来赋值。而且,VB 不允许使用大于 4 字节的整数文字。作为一种 解决方法,您可以提供一个包含该值的字符串。例如:

 Dim aHyper As Variant
 aHyper = CDec("9223372036854775807")


Visual Basic .NET 有内置类型 decimal 并且不限制整数文字。


如果从 UNO 调用 Automation 对象,则可以使用 com.sun.star.bridge.oleautomation.Decimal 类型为 Decimal 类型的 Automation 参数提供参数。返回的 Decimal 值将被转换成 com.sun.star.bridge.oleautomation.Decimal


Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages