مشاهدة النسخة كاملة : مساعدة
اذا ممكن حد يشرحلي ال function , procedures انا فاهم الفكرة العامة بس مش فاهم امتا بنستعمل function وامتا بنستعمل procedures و byref , byval
u use function when u need it... :D
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)
u use function when u need it...:D i know but i mean what the differance between the function and the procedures
amgadpasha
25-10-2004, 05:02 PM
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
moh_mhe
25-10-2004, 11:39 PM
Procedure
يمكنك عمله لإجراءات معينة مع إرسال Parameters و لكن بدون إرجاع قيمة
Fuction
نفس عمل Procedure ولكن يمكنك إرجاع قيمة
Example to calculate the sum of to numbers by VB
Procedure:
Sub GetSum(Val1 As long,Val2 As Long,ByRef Val_Sum As long)
Val_Sum =Val1 +Val2
End Sub
Function:
Function F_GetSum(Val1 as long,Val2 as Long) As Long
F_GetSum =Val1 +Val2
End Sub
''How to get the sum of 4 and 5
Procedure:
Dim V_SUM As long
Call GetSum 4,5, V_SUM
'Function:
V_SUM =f_GetSum(4,5)
thanks for everyone
i use VB6 :D
جميع حقوق برمجة vBulletin محفوظة ©2025 ,لدى مؤسسة Jelsoft المحدودة.
جميع المواضيع و المشاركات المطروحة من الاعضاء لا تعبر بالضرورة عن رأي أصحاب شبكة المنتدى .