Passing a variable (Class) to a sub and using the passed variable to make changes results in the calling routine having its copy adjusted suggesting that BYVAL is not being used for Class objects.
Example Code
```
Class Switch
Public Name
Public IP
End Class
sub Test(byval lsw)
lsw.Name = "From Sub"
end sub
set LSwitch = new Switch
LSwitch.Name = "Outside"
writeline("Name : " & LSwitch.Name)
Test LSwitch
writeline("Name : " & LSwitch.Name)
```
Resulting Output :
```
Name : Outside
Name : From Sub
```
Comments: Looks to me like I should have checked this first http://computer-programming-forum.com/59-vbscript/73895c1f1448b205.htm
Example Code
```
Class Switch
Public Name
Public IP
End Class
sub Test(byval lsw)
lsw.Name = "From Sub"
end sub
set LSwitch = new Switch
LSwitch.Name = "Outside"
writeline("Name : " & LSwitch.Name)
Test LSwitch
writeline("Name : " & LSwitch.Name)
```
Resulting Output :
```
Name : Outside
Name : From Sub
```
Comments: Looks to me like I should have checked this first http://computer-programming-forum.com/59-vbscript/73895c1f1448b205.htm