|
-
Jul 15th, 2000, 10:53 AM
#1
Thread Starter
Member
How do you get an address of a variable?
The set keyword doesn't work.
I would like to pass the address of a boolean variable
to a form I'm loading through Sub Init so i know that the
form is finished in the procedure I'm loading it from.
Public Finished As Boolean
Public Sub Init(ByRef Fin As Boolean)
Set Finished = Fin
End Sub
Basicly I would like to set the address of Fin to the address of Finished.
Thanx, Tadej
-
Jul 15th, 2000, 01:28 PM
#2
Frenzied Member
The Best Way is to Make a Simple Class Module Wrapping a Bolean, VB's Class Builder Gave me this
Code:
Option Explicit
'local variable(s) to hold property value(s)
Private mvarValue As Boolean 'local copy
Public Property Let Value(ByVal vData As Boolean)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.Value = 5
mvarValue = vData
End Property
Public Property Get Value() As Boolean
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.Value
Value = mvarValue
End Property
Whenever you Pass This Around it will be passed By Reference, ie the instances set = to each other all point to the Same Address.
Hope this Helps
-
Jul 15th, 2000, 01:46 PM
#3
Lively Member
Pointer variables?
It might be possible to declare pointer variables in VB - I know you can do this in pure C++ but I'm not sure about VB. Pointer variables hold memory addresses, you see.
If I figure out how to do this I'll let you know soon - ok?
-
Jul 15th, 2000, 01:58 PM
#4
Thread Starter
Member
I know about pointers in C++.
I'm wondering if there is any way of
doing this in VB.
Or is it only possible in VB to set references
of objects with the Set statement.
Thank you for answering,
Tadej
-
Jul 15th, 2000, 04:23 PM
#5
Frenzied Member
There's nothing in VB that concerns pointers,The Set Statement sets reference to an object, unfortunatley normal booleans aren't objects, which is why you need to create the class.
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
|