Somebody's help wrote:
CInt Function [Runtime]
Converts any string or numeric expression to an integer.
Yes.
But "any string" may not be recognized as "numeric", even if the user thought it was. CInt(something) generally returns the value 0 if 'something' not was accepted as numeric. Strings starting with a "+" character were not regarded numeric also by the Basic function ISNUMERIC() due to a legacy bug for a long time.
And what is accepted as a "numeric expression" in this specific context isn't explained - and isn't subject to the ODF specifications.
LibreOffice got fixed THIS bug some time ago. However, you shouldn't think the life of bugs generally is too hard in LibO.
The offhand example
I just tried in Basic under LibO 7.3.3.2 returned neither an error nor a value of 0 or -67 for h, but h = 10 - and so does the less ambitious
Programming in Basic you walk over cracky ice. If you need reliable results, you shouldn'tuse functions where any faint doubt exists. The help texts never are precise enough. They aren't sufficiently complete either.
BTW
In the context of formula evaluation in Calc
is an error, while
evaluates to -67 regarding the specifications concerning automatic type conversion.
In Basic, on the other hand, "10" + "77" makes "1077" because, based on a convention from the stone-age, Basic still uses the operator + also for concatenation if the context allows it.
Overloaded operators are a way to hell.
Write a few extra lines of code instead of trusting in doubtable automatisms.