EnVeeTee,
[quoted text, click to view] > CodeAdvisor does not like the ...objLabel as Object... and complains about
> late binding
To avoid a late binding warning you need to use early binding. To use early
binding you need to explicitly define the types.
[quoted text, click to view] > Sub ChangeAllColours(objLabel as Object, ColourToChangeTo&)
>
> for n=0 to objLabel.count
> objlabel(n).color=colourtochangeto&
> next n
>
> end sub
Appears to be an array of labels, so you could use something like:
[quoted text, click to view] > Sub ChangeAllColours(objLabel as Label(), ColourToChangeTo As Color)
I would consider an array of Controls instead:
[quoted text, click to view] > Sub ChangeAllColours(objLabel as Control(), ColourToChangeTo As Color)
NOTE: The above are the VB.NET code...
--
Hope this helps
Jay B. Harlow
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net [quoted text, click to view] "EnVeeTee" <withheld@nospam.com> wrote in message
news:ubkwXIXBHHA.3228@TK2MSFTNGP03.phx.gbl...
> Just curious...
>
> I have a large '6 app and ran it through the CodeAdvisor. Most issues seem
> dealable with, however...
>
> I pass a LOT of Control Arrays through to Class modules. CodeAdvisor
> squeals about late binding, so how could I recode this code section...
>
>
> .
> .
> Call ChangeAllColours(lblCtrlArray,vbBlue)
> .
> .
>
>
> In Class
>
> Sub ChangeAllColours(objLabel as Object, ColourToChangeTo&)
>
> for n=0 to objLabel.count
> objlabel(n).color=colourtochangeto&
> next n
>
> end sub
>
>
> CodeAdvisor does not like the ...objLabel as Object... and complains about
> late binding
>
> Thanks for any tips
>
>
>