Call by ref. and call by value in an y function

Thread: Call by ref. and call by value in an y function

1. Junior Member
Join Date
Dec 1969
Posts
6

Call by ref. and call by value in an y function

What is the differance between Call by ref. and call by value in any function?<BR>

2. Senior Member
Join Date
Dec 1969
Posts
96,118

See article on 4Guys...

http://www.4guysfromrolla.com/webtech/050201-1.shtml<BR><BR>It talks about ByRef and ByVal in connection with objects and arrays. Other types aren&#039;t that much different:<BR><BR>&#060;%<BR>Sub one( ByVal arg )<BR>&nbsp; &nbsp; arg = 3<BR>End Sub<BR><BR>Sub two( ByRef arg )<BR>&nbsp; &nbsp; arg = 3<BR>End Sub<BR><BR>val = 17<BR>Response.Write "Before call to one, val is " & val & "&lt;BR&#062;"<BR>one val<BR>Response.Write "After call to one, val is " & val & "&lt;BR&#062;"<BR>two val<BR>Response.Write "After call to two, val is " & val & "&lt;BR&#062;"<BR>%&#062;<BR><BR>Try that, using strings instead of numbers, etc., etc.<BR><BR>[ Yeah, yeah, I know--I&#039;m on vacation. But I helped install AOL on my Mom&#039;s machine, and... ]<BR><BR>

3. J. Paul Schmidt Guest

And of course there's the FAQ

Good article Bill! And since you almost always seem to know when a question can be answered by a FAQ, I just had to take the liberty of pointing this one out...<BR><BR>4GuysFromRolla.com : ASP FAQS : Functions and Subroutines <BR>Question: I&#039;ve seen function definitions that include ByRef and ByVal statements. What are these? by Scott Mitchell - 9/27/2000<BR>http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=33<BR><BR>Best regards,<BR>-Paul<BR><BR>J. Paul Schmidt, MBA<BR>Databases on the Web<BR>http://www.Bullschmidt.com<BR><BR>

4. Senior Member
Join Date
Dec 1969
Posts
96,118

Got me...

Doh! I forgot that one was there! Number 33...man, that goes back to the first FAQs Scott put up there, even! Shame on me.<BR><BR>Thanks for comment on article. No sooner did I send it off than I got a couple of new questions, so there might still be a part 4, after all. (See moderated advanced forum, where a person asks why he can&#039;t assign an array to another array. And, then, there is the subtle difference between a DIMmed array and a REDIMmed array.)<BR><BR>I&#039;m out of here until next week...off to the California Coast, I hope, tomorrow!<BR><BR><BR>

5. everthankful Guest

Enjoy

Enjoy the hol...take care and return to us "asp" needy persons soon!!

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•