Hello
such a simple problem but it's driving me mad. Code is below, just need to set up pointer (gimme C...) to variable c passed into proc and then use than pointer (var2) to updated value. Have tried declaring things as objects, integer, using set, not using set, byref, not byref etc etc.
Before you suggest it I don't want to alter the global/local setup of variables as actual code is far more complex and larger than this and I don't want to have to rewrite the entire thing.
Thanks - Kate
Dim var2
Private Sub Command1_Click()
proc1
End Sub
Private Sub proc1()
Dim c As Integer
c = 99
proc2 c
Print "now in proc1 value of c is " & c 'should output 1
End Sub
Private Sub proc2(c)
Print "now in proc2 value of c is " & c 'should output 99
Set var2 = c
var2 = 1
End Sub
such a simple problem but it's driving me mad. Code is below, just need to set up pointer (gimme C...) to variable c passed into proc and then use than pointer (var2) to updated value. Have tried declaring things as objects, integer, using set, not using set, byref, not byref etc etc.
Before you suggest it I don't want to alter the global/local setup of variables as actual code is far more complex and larger than this and I don't want to have to rewrite the entire thing.
Thanks - Kate
Dim var2
Private Sub Command1_Click()
proc1
End Sub
Private Sub proc1()
Dim c As Integer
c = 99
proc2 c
Print "now in proc1 value of c is " & c 'should output 1
End Sub
Private Sub proc2(c)
Print "now in proc2 value of c is " & c 'should output 99
Set var2 = c
var2 = 1
End Sub