I do not know when the change was made, but, CLng used to be able to
convert "negative" values represented as Hex, but, not in 3.20. I last
tested in version 2.x. Here is my latest code to show this:
Sub ExampleCLngWithHex
On Error Resume Next
Dim s$, i%
Dim v()
v() = Array("&HF", "&HFF", "&HFFF", "&HFFFF",_
"&HFFFFF", "&HFFFFFF", "&HFFFFFFF", "&HFFFFFFFF",_
"&HFFFFFFFFF",_
"&HE", "&HFE", "&HFFE", "&HFFFE",_
"&HFFFFE", "&HFFFFFE", "&HFFFFFFE", "&HFFFFFFFE",_
"&HFFFFFFFFE")
For i = LBound(v()) To UBound(v())
s = s & i & " CLng(" & v(i) & ") = "
s = s & CLng(v(i))
s = s & CHR$(10)
Next
MsgBox s
End Sub
This fails on CLng("&HFFFFFFFF") rather than returning -1. Add an extra
F and it quietly fails internally and returns 0.
Should I open a bug on this or simply document this and move on. yeah, I
am writing again.
--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info: http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org