Code Module and Label

Vincenzo

Member
Licensed User
Longtime User
hi,
You can keep the reference of a label in a "Code Module"?

if I try:

sub Process_Globals
Dim Lab As Label
end Sub

Configure Sub (L As Label)
Lab = L
end Sub


I get an error:

Error compiling program.
Error Description: Can not access object from sub Process_Globals activity.
 
You cannot declare views in Sub Process_Globals !
They must be declared in Sub Globals.
In your case:
Code: Copy
Sub Globals
     Dim Lab As Label
End Sub
If you have a code module Config with a routine:
Code: Copy
Sub SetText(lbl as Label, txt as String)
    lbl.Text = txt
End Sub
You can call it from the main module and transmit the label as a parameter:
Code: Copy
Config.SetText(Lab, "Test")
Best regards.
 
Upvote 0
Back
Top