UBound(arrayname[, dimension])
The UBound function syntax has these parts:
Part | Description |
---|---|
arrayname | Required. Name of the array variable; follows standard variable naming conventions. |
dimension | Optional; Long. Whole number indicating which dimension's upper bound is returned. Use 1 for the first dimension, 2 for the second, and so on. If dimension is omitted, 1 is assumed. |
The UBound function is used with the LBound function to determine the size of an array. Use the LBound function to find the lower limit of an array dimension.
UBound returns the following values for an array with these dimensions:
Dim A(1 To 100, 0 To 3, -3 To 4)
Statement | Return Value |
---|---|
UBound(A, 1) |
100 |
UBound(A, 2) |
3 |
UBound(A, 3) |
4 |
Dim Statement | LBound Function | Public Statement | ReDim Statement
RaiseEvent eventname [(argumentlist)]
The required eventname is the name of an event declared within the module and follows Basic variable naming conventions.
If the event has not been declared within the module in which it is raised, an error occurs. The following fragment illustrates an event declaration and a procedure in which the event is raised.
' Declare an event at module level of a class module Event LogonCompleted (UserName as String) Sub ' Raise the event. RaiseEvent LogonCompleted ("AntoineJan") End Sub
You can't use RaiseEvent to fire events that are not explicitly declared in the module. For example, if a form has a Click event, you can't fire its Click event using RaiseEvent. If you declare a Click event in the form module, it shadows the form’s own Click event. You can still invoke the form’s Click event using normal syntax for calling the event, but not using the RaiseEvent statement.
Event firing is done in the order that the connections are established. Since events can have ByRef parameters, a process that connects late may receive parameters that have been changed by an earlier event handler.
Adding an Event to a Form | Adding Events to a Class | Adding Events to Classes | Event Statement | Raising Events from Controls