Class ArgumentTypedFunctions
The functions of the standard library whose call is of the declared type of its argument: Abs, Int and Fix of a numeric value.
public static class ArgumentTypedFunctions
- Inheritance
-
ArgumentTypedFunctions
- Inherited Members
Remarks
MS-VBAL §6.1.2.10.1.1 (Abs), §6.1.2.3.1.16 (Fix) and §6.1.2.3.1.18 (Int) declare each
As Variant, which returns "a value of the same value type" as a number it is given. MS-VBA types the call itself as its argument's declared type
when that is a numeric type: Fix(n) of an Integer is an Integer, and Fix(n) * 7000 is a product of Integers, which
overflows (error 6) where a Variant product would be a Long (recorded in Excel: oracle\s46 F10, as vb6.exe does). RD-VBA types the call as
MS-VBA does, and warns where the difference shows.
An argument of any other declared type - a Variant, a String, a Boolean, a Date - leaves the call a Variant, as declared.
Methods
DeclaredTypeOfCall(Symbol, VBType?)
The declared type of a call of procedure given an argument of argumentType, when it is not the one
procedure declares: the argument's, for Abs, Int or Fix of a numeric value.
public static VBType? DeclaredTypeOfCall(Symbol procedure, VBType? argumentType)
Parameters
procedureSymbolThe procedure called.
argumentTypeVBTypeThe declared type of its one argument, if it is known.
Returns
IsTypedByItsArgument(Symbol)
Whether procedure is the standard library's Abs, Int or Fix, whose call is of its argument's numeric type.
public static bool IsTypedByItsArgument(Symbol procedure)
Parameters
procedureSymbolThe procedure.