اذا ممكن حد يشرحلي ال function , procedures انا فاهم الفكرة العامة بس مش فاهم امتا بنستعمل function وامتا بنستعمل procedures و byref , byval
اذا ممكن حد يشرحلي ال function , procedures انا فاهم الفكرة العامة بس مش فاهم امتا بنستعمل function وامتا بنستعمل procedures و byref , byval
u use function when u need it...![]()
byval means the parameter value passed into the function or procedure can not be changed when the application returns from the function or procedure...
byref or ref or & or % means that the value of the original variable that was passed as a parameter to this function or proc. can be changed when the application returns from the function or proc.
C/CPP/CPP.NET:
it is good practice to pass huge variables to a function as a constant reference...(effecient)
i know but i mean what the differance between the function and the proceduresu use function when u need it...![]()
what s th language u r using, not all th language supports procedures, mainly proc r functions that doesn't return values, so u call them for doing something, like printing something on the screen or whatever static senarios, sometimes procedurs also doesn't take parameters or arguments, so it's just a fixed behaviour, but again, this is based on the language u r using, in c for example there is nothing called procedurs
و الجهل زاد فى البتاع, لا مقرى ولا منقول...
Procedureيمكنك عمله لإجراءات معينة مع إرسال Parameters و لكن بدون إرجاع قيمةFuctionنفس عمل Procedure ولكن يمكنك إرجاع قيمةExample to calculate the sum of to numbers by VBProcedure:Sub GetSum(Val1 As long,Val2 As Long,ByRef Val_Sum As long)Val_Sum =Val1 +Val2End SubFunction:Function F_GetSum(Val1 as long,Val2 as Long) As Long
F_GetSum =Val1 +Val2End Sub''How to get the sum of 4 and 5Procedure:Dim V_SUM As longCall GetSum 4,5, V_SUM'Function:V_SUM =f_GetSum(4,5)
thanks for everyone
i use VB6![]()