ID : 447
Procedure
Procedure refers to a unit of sets of processing (statements).
A procedure is described between a procedure declaration (Sub | Function) and End statement.
Each procedure in a task can be called by Call statement, etc. without any constraint.
Sub Procedure and Function Procedure
There are 2 types of procedure: Sub procedure and Function procedure.
Sub Procedure
Execute an action.
Does not return any value to the caller.
Function Procedure
Execute an action.
Return a value to the caller.
Can be described on the right side of an assignment expression in caller's program.
Procedure Name
Each procedure must be named in accordance with the Naming convention.
Each procedure name, whether Sub or Function, must be unique within a task. Even when a program file is loaded by #Include, all procedure names must be unique.
Entry Point (Main procedure)
When a procedure is named "Main," the procedure is specially treated as an entry point of the program. When starting a program, you need to designate a program name to launch. At this point, the Main procedure in the program is executed. This also applies to program startup by Run statement. Such Main procedure is called an "entry point" of each program.
You may create a program without Main procedure, but such program cannot be executed.
ID : 447