| | |
passing values
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
Umm ecaal statement???
OK, see if this helps.
Dim nValue1 as Integer
Dim nValue2 as Integer
Dim nResult as Integer
nValue1 = 5
nValue2 = 10
nResult = AddValues(nValue1, nValue2)
Function AddValues(Paramater1 as Integer, Parameter2 as Integer) as Integer
AddValues = Parameter1 + Parameter2
Return AddValues
End Function
Msgbox "The Result is: " nResult
The values are passed to the procedure by Calling the AddValues Function, which accepts to arguements (or parameters).
1. ByVal is used when you don't want the procedure (function) to modify the variable that is passed to the procedure through an arguement.
2. ByRef is ued when you want to allow the procedure to modify the variable that is passed to the procedure.
Hope this helps
OK, see if this helps.
Dim nValue1 as Integer
Dim nValue2 as Integer
Dim nResult as Integer
nValue1 = 5
nValue2 = 10
nResult = AddValues(nValue1, nValue2)
Function AddValues(Paramater1 as Integer, Parameter2 as Integer) as Integer
AddValues = Parameter1 + Parameter2
Return AddValues
End Function
Msgbox "The Result is: " nResult
The values are passed to the procedure by Calling the AddValues Function, which accepts to arguements (or parameters).
1. ByVal is used when you don't want the procedure (function) to modify the variable that is passed to the procedure through an arguement.
2. ByRef is ued when you want to allow the procedure to modify the variable that is passed to the procedure.
Hope this helps
•
•
Join Date: Mar 2005
Posts: 3
Reputation:
Solved Threads: 0
Sorry about the mis-spelling.Yes it does help, I am curious though, can I have an event procedure(btnDisplay_click) call Function AddValues, and then have another event procedure(btnTotal_click) call the Function AddValues?Or do I need to make it a Sub procedure? Thank You for your help. I do seem to be having a brain-fart with this one
![]() |
Similar Threads
- passing values from a form to a dialog form (VB.NET)
- passing values of Select box from JSP to Action class thru form Bean (JSP)
- Passing values (ASP.NET)
- Passing values with textbox (C#)
- multiColumn control passing values to listbox and back (ASP.NET)
- passing of values through image link (PHP)
- Passing values between functions (C++)
- Passing Variable Values as a parameter Name in MySQL (MySQL)
Other Threads in the VB.NET Forum
- Previous Thread: link text boxes with listbox
- Next Thread: Counting text in a field
| Thread Tools | Search this Thread |
"crystal .net .net2008 2008 access add advanced application array assignment basic beginner box browser button buttons center click code combo convert cpu cuesent data database datagrid datagridview datetimepicker designer dissertation dissertations dissertationtopic dosconsolevb.net eclipse editvb.net employees excel exists firewall forms html images isnumericfuntioncall listview map math memory mobile module msaccess mssqlbackend mysql navigate net number opacity open pan pdf picturebox picturebox2 port print printpreview record regex reuse right-to-left save search serial settings socket sorting sqldatbase sqlserver storedprocedure temp textbox timer timespan transparency txttoxmlconverter upload useraccounts usercontol vb vb.net vb.nettoolboxvisualbasic2008sidebar vba vbnet vista visual visualbasic visualbasic.net visualstudio.net web wpf wrapingcode xml






