R
Rich
I am trying to get straight on using Friend and Shared. I pass a form object
(a Form Class object - Form1 for example) to a app level procedure and I want
to expose some form level variables to the procedure.
'call procedure from Form1
Private Sub btn1_Click...
someProce(me)
End Sub
Public someProc(frm As Form1)
'--if I declare a var in form1 as public I can do this which I do not want
console.writeline(var.tostring)
'--I want to require the form1 var to be prefaced with frm
console.writeline(frm.var.tostring)
If I declare the var in form1 as Friend var as String
then I need to preface var with frm in the procedure. Is this the correct
way to do this?
While I am at it - when is it time to use Shared? Is Shared like Friend?
Is Shared only for procedure/functions/class objects?
thanks
Rich
(a Form Class object - Form1 for example) to a app level procedure and I want
to expose some form level variables to the procedure.
'call procedure from Form1
Private Sub btn1_Click...
someProce(me)
End Sub
Public someProc(frm As Form1)
'--if I declare a var in form1 as public I can do this which I do not want
console.writeline(var.tostring)
'--I want to require the form1 var to be prefaced with frm
console.writeline(frm.var.tostring)
If I declare the var in form1 as Friend var as String
then I need to preface var with frm in the procedure. Is this the correct
way to do this?
While I am at it - when is it time to use Shared? Is Shared like Friend?
Is Shared only for procedure/functions/class objects?
thanks
Rich