hi,A little explanation needs here for the question that i wanna?
pls.....whoever knows the answer, thanks ;)))
hi,A little explanation needs here for the question that i wanna?
pls.....whoever knows the answer, thanks ;)))
if i understand the question, procedural means you're just putting line after line of code... with functions, you can call the function time and time again instead of rewriting all the code repeatedly. (ie. it's time saving and efficient)
I guess you mean the difference between a procedure and a function in VB. In general, a function is a block of code that gets parameters and after running it's code returns a value to the calling code. A procedure is just a block of code that can be called without returning a value.
Note that you can call a function and not use it's value, but it will always return it and therefor is still considered a function.
In VB, you have to use braces with functions that return a value if you use this value. If you don't use it or call a procedure that by definition has no return value, braces are not allowed.
( crazy concept :mad: )
yeah... i hate that... i always mess that up.. :rolleyes:
hi,can u provide some sample code to differentiate the procedural and function in VB? plssssssssssss
To call a function you write:Code:For a procedure you have:
Sub swap(int a, int b)
Dim c As Integer
c = a
a = b
b = c
End Sub
For a function you have:
Function sum(int a, int b) As Integer
sum = a + b
End Function
Dim result as integer
result = sum(23,45)
To call a procedure you write:
Dim first as integer
Dim second as integer
first = 23
second = 34
swap first, second
And it's not "procedural". It is "procedure". Procedural is a programming method on which VB relies heavily. Procedural programming is programming based on procedures and functions when opposed to Object Oriented Programming (OOP) where classes, property functions and methods are used.