18.01.2013 Views

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong> <strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong><br />

Int<br />

Description Returns the integer portion of a number<br />

Usage intVal = Int(number)<br />

Arguments number<br />

The number argument can be any valid numeric expression.<br />

Return An integer value<br />

Remarks If number contains Null, Null is returned. Int is internationally aware, meaning the return value is<br />

based on the Locale setting on the PC. The data type will be determined from the size of the<br />

Integer part. Possible return data types are Integer, Long, Double.<br />

Both Int and Fix remove the fractional part of number and return the resulting integer value.<br />

The difference between Int and Fix is that if number is negative, Int returns the first negative<br />

integer less than or equal to number, whereas Fix returns the first negative integer greater than<br />

or equal to number. For example, Int converts -8.4 to -9, and Fix converts -8.4 to -8. Fix(number)<br />

is equivalent to: Sgn(number) * Int(Abs(number)).<br />

See also Fix, Round, CInt, CLng<br />

Example MyNumber = Int(99.8) ' Returns 99.<br />

MyNumber = Fix(99.2) ' Returns 99.<br />

MyNumber = Int(-99.8) ' Returns -100.<br />

MyNumber = Fix(-99.8) ' Returns -99.<br />

MyNumber = Int(-99.2) ' Returns -100.<br />

IsArray<br />

Description Returns a Variant subtype Boolean value indicating whether a variable is an array<br />

Usage result = IsArray(varname)<br />

Arguments varname<br />

The varname argument can be any variable subtype<br />

Returns IsArray returns True if the variable is an array; otherwise it returns False.<br />

See also IsDate, IsEmpty, IsNull, IsNumeric, IsObject, and VarType<br />

Example Dim MyVariable<br />

Dim MyArray(2)<br />

MyArray(0) = “Sunday”<br />

MyArray(1) = “Monday”<br />

MyArray(2) = “Tuesday”<br />

MyVariable = IsArray (MyArray) ‘ MyVariable contains True<br />

IsDate<br />

Description Returns a Boolean value indicating whether an expression can be converted to a valid date.<br />

Usage boolVal = IsDate(expression)<br />

Arguments expression<br />

The expression argument can be any date expression or string expression recognizable as a<br />

date or time.<br />

Remarks IsDate returns True if the expression is a date or can be converted to a valid date; otherwise, it<br />

returns False. In Microsoft Windows, the range of valid dates is January 1, 100 A.D. through<br />

December 31, 9999 A.D.; the ranges vary among operating systems.<br />

See Also CDate, IsArray, IsEmpty, IsNull, IsNumeric, IsObject, VarType<br />

Example The following example uses the IsDate function to determine whether an expression can be<br />

converted to a date:<br />

Dim MyDate, YourDate, NoDate, MyCheck<br />

MyDate = "October 19, 1962"<br />

YourDate = #10/19/62#<br />

NoDate = "Hello"<br />

MyCheck = IsDate(MyDate) ' Returns True.<br />

MyCheck = IsDate(YourDate) ' Returns True.<br />

MyCheck = IsDate(NoDate) ' Returns False.<br />

142 <strong>InduSoft</strong>, Ltd.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!