|
-
Feb 27th, 2001, 08:25 PM
#1
Thread Starter
New Member
Hi,
I have been learning a little ASP and VbScript. However one example in the book i am using refers to 'ByVal' in some code and does not really make any reference to it.
Below is the sample code. As you can see 'Byval' is inbetween the brackets where the variable declarations go. However nowhere is 'ByVal' referred to as a variable and as I understand it when there is more than one variable there should be a ','.
Anyway if anyone can explain this to me i would be extremely gratefull.
public Property Let CurrentSpeed(ByVal iSpeedIn)
internal_speed = iSpeedIn
End Property
-
Feb 27th, 2001, 09:42 PM
#2
Originally posted by Iain17
ByVal
Passes a copy of the variable to the sub / function. Thus the actual value of the variable is
placed on the stack. Any modification to the variable are local to this sub and are not
mirrored on the calling sub.
-
Feb 28th, 2001, 09:35 AM
#3
Frenzied Member
ByRef
The oppisite is ByRef. There you pass the reference to the variable, which means any local change will change the value of the variable in the calling scope.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
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
|