M
mikeFin
I guess this is more a VBA question, than a Visio-specific question, but I
hope someone could help.
Some code I have:
- - - - - -
Public Function func1(var1 as Integer, var2 as Integer)
....
var1=0
....
End Function
Sub Main()
Dim money1 as Integer
Dim resultA as Integer
Dim resultB as Integer
money1 = 20
resultA = func1(money1,60)
resultB = func1(money1,70)
End Sub
- - - - - -
My Problem is that resultB is wrong, because for some reason, money1 is 0
after the first function call.
Shouldn'it stay at 20 ?
I thought, this kind of things might happen, if I passed the argument
ByReference, but thats not what I wanted to do...
I just read again some pages on msdn... it looks like I definied the
variable ByRef. How could I define the variable money1 ByValue ´?
hope someone could help.
Some code I have:
- - - - - -
Public Function func1(var1 as Integer, var2 as Integer)
....
var1=0
....
End Function
Sub Main()
Dim money1 as Integer
Dim resultA as Integer
Dim resultB as Integer
money1 = 20
resultA = func1(money1,60)
resultB = func1(money1,70)
End Sub
- - - - - -
My Problem is that resultB is wrong, because for some reason, money1 is 0
after the first function call.
Shouldn'it stay at 20 ?
I thought, this kind of things might happen, if I passed the argument
ByReference, but thats not what I wanted to do...
I just read again some pages on msdn... it looks like I definied the
variable ByRef. How could I define the variable money1 ByValue ´?