Procedure
- A block of code that performs a task.
- Does not return a value.
PROCEDURE Name()
// statements
ENDPROCEDURE
Function
- A block of code that performs a task.
- Returns a value.
FUNCTION Name() RETURN <data type>
// statements
ENDFUNCTION
Key Difference:
- Use a procedure when you just want to execute instructions.
- Use a function when you need to calculate and return a result.
No comments:
Post a Comment