|
-
July 10th, 2001, 12:12 PM
#3
Re: SCOPE Question
The use of FRIEND Function type is designed to pass variables between classes.
Define a Friend Function in Class A for example then when Class B needs access to CLass A variables, It calls the Friend Function which returns the desired variable.
An example is enclosed, taken from Running COde
' Class A
friend property let CurrentPageNO(byval vData as Long)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.CurrentPageNO = 5
mvarCurrentPageNO = vData
End property
friend property get CurrentPageNO() as Long
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.print X.CurrentPageNO
CurrentPageNO = mvarCurrentPageNO
End property
''
'
' following is Class B code
'
'
' In this case CLass A is actually the Parent of Class B
CLass B retrieves Class A CurrentPageNo
frm.txtPage.Text = "Page " & Parent.CurrentPageNO & " of " & Parent.TotalPages
'
John G
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|