VB Language

The following Visual Basic commands have been tested with IDEA v9 and appear to be functioning properly. I have added some examples where possible on their use.

DateValue()

Syntax: DateValue(StringDate as String) as Date

The DateValue function assignes a specific data to a type Date variable.  Converting a string representation of a date into a Date value.

Parameters: The StringDate can be different date formats in string, the following are a few examples:

  • "January 10 2007"
  • "January 10" - defaults to current system year
  • "Jan 10 2007"
  • "10/Jan/2007"
  • "10/01/2007"
  • "10/Jan/2007 14:10:10" - won't return the time portion

Day()

Syntax: Day(DateValue as Date) as integer

Day(date) Returns a value 1–31 representing the day of the month

Parameter: The DateValue must be a valid date.

Do...Loop Statement

The Do...Loop statement, or Do for short, is used to execute a block of statements repeatedly—in other words, to loop through the statements.

This statement comes in several variations that can meet essentially any program need.

Double

Name: Double

Type: Floating Point

Rangle: -1.79 × 10308 to 1.79 × 10308 approximately

Precision: 14 digits

Dynamic Arrays

A dynamic array does not have a fixed size. It can be enlarged or shrunk as needed by code during program execution. A dynamic array is declared by using empty parentheses in the Dim statement.

Before using the array, you must set its size using the ReDim statement.

Exp()

Returns a number containing the base of a natural logarithm (e) raised to the specified power.  The return value is a double type.

Fix()

The Fix() and Int() functions both remove the fractional part of a number and returns the restulting integer.  The difference between the two is that if a number is negative Int() returns the first negative integer less than or equal to the number while Fix returns the first negative integer greater than or equal to the numer.

Floating point

String variables are used to hold text data.  A fixed-length string can be declared to contain anywhere from 1 to about 64,000 characters.  To declare a fixed-length string, use the String keyword followed by the * (asterisk) symbol and the desired size.

For...Next Statement

The For...Next statement repeats a block of code a specified number of times.

  • Index is a variable that is used to count loop repetitions. It is usually declared to be type Integer.
  • Start is an expression specifying the starting value of index.
  • Stop is an expression specifying the ending value of index.

Optionally, For...Next can use an increment value other than 1.

FormatDateTime(Date, NamedFormat)

Date is the date expression to be formatted. NamedFormat is an optional constant that specifies how the date is formatted.

Pages