callbyname

Drstein99

Well-known member
Joined
Sep 26, 2003
Messages
283
Location
Audubon, Nj
Please help, I cant figure out why I cant call the following function (being called from form1.vb):

says "is a type and can not be used as an expression"

CallByName(globalFunction, "YesOrNo", CallType.Method)



I have the CLASS in my mainmodule.vb, defined outside the "MODULE MAIN" definition

Public Class globalFunction
Private Function YesOrNo()
If MsgBox("pQuestion", MsgBoxStyle.YesNo, "Script Question") = MsgBoxResult.Yes Then
Return pAnswer1
Else
Return pAnswer2
End If
End Function
End Class
 
Well, I since then figured out what I was doing wrong. Had to declare a class in the main.vb. Then from the class I added functions and works fine.
 
Back
Top