last late binding error

D

Dean Slindee

Notice the one 'LATE BINDING ERROR line at the bottom, the rest of the code
is just the context.

How can this one line be coded to comply with Option Strict ON?

'== Calling form =============================

Public arrStatus(3) As String

'housekeeping

arrStatus(0) = "Ready"

arrStatus(1) = ""

arrStatus(2) = Date.Now.ToShortDateString()

arrStatus(3) = Date.Now.ToShortTimeString()

Call FormStatusBarPaint(Me, arrStatus)

'=== Called function ==========================

Public Function FormStatusBarPaint(ByVal frm As Form, _

ByVal strArray As Array) As Integer

Dim ctl As New Control

Dim sbr As StatusBar

Dim int As Integer

Dim intBounds As Integer

intBounds = strArray.GetUpperBound(0)



For int = 0 To intBounds

sbr.Panels(int).Text = strArray(int) 'LATE BINDING ERROR

Next

End Function



Thanks,

Dean Slindee
 
K

Ken Tucker [MVP]

Hi,

sbr.Panels(int).Text = strArray(int) .tostring


Ken
-----------------------
Notice the one 'LATE BINDING ERROR line at the bottom, the rest of the code
is just the context.

How can this one line be coded to comply with Option Strict ON?

'== Calling form =============================

Public arrStatus(3) As String

'housekeeping

arrStatus(0) = "Ready"

arrStatus(1) = ""

arrStatus(2) = Date.Now.ToShortDateString()

arrStatus(3) = Date.Now.ToShortTimeString()

Call FormStatusBarPaint(Me, arrStatus)

'=== Called function ==========================

Public Function FormStatusBarPaint(ByVal frm As Form, _

ByVal strArray As Array) As Integer

Dim ctl As New Control

Dim sbr As StatusBar

Dim int As Integer

Dim intBounds As Integer

intBounds = strArray.GetUpperBound(0)



For int = 0 To intBounds

sbr.Panels(int).Text = strArray(int) 'LATE BINDING ERROR

Next

End Function



Thanks,

Dean Slindee
 
H

Herfried K. Wagner [MVP]

Dean Slindee said:
Notice the one 'LATE BINDING ERROR line at the bottom, the rest of the
code
is just the context.

How can this one line be coded to comply with Option Strict ON?
[...]
ByVal strArray As Array) As Integer

'ByVal strArray As Array' => 'ByVal strArray() As String'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top