<< Prev        Next >>

ID : 5227

Overview of Program Configuration

A program consists of following compornents.

  • Main procedure
    A program which perform as a major role in the program. Each program file has only one main program. A main procedure is a program that becomes a leading part of each program file and exists only by one per one program file. A main procedure starts by "Sub Main", and ends with "End Sub". This program becomes basic of the program operation. More than one sub-procedure and function-procedure can be built in the main procedure to create a series of program.
  • Sub procedure
    A sub procedure is a procedure which is frequently called from other program and written exclusively. This procedure can be called by a main procedure or other sub procedures. Sub procedures can include function procedure. More than one sub procedures can be written in one program file. A sub procedure starts by "Sub Main", and ends with "End Sub".
  • Function procedure
    A procedure which is designated by user. More than one function procedures can be written in one program file. A function procedure starts by "Function" and ends with"End Function".
  • Entry point
    A point where a main procedure starts.

A function described here is a calculation formula which meets following criteria.

  1. Include "=".
  2. Include variables and the form is "Variable = calculation formula"
  3. When you enter parameter value, calculation result will be generated to variable.
    Example: bbb = FuncA(aaa)
    In this case, "bbb" is variable and the calculation result will be generated to it. "aaa" is parameter.

Subroutine

A section of a program that repeats a specific motion can be put out of the program and called if required.

The method of putting this section in the same program is called a subroutine. If this section is independently put in a separate file as another program and that program is called, this is referred to as calling a program.

A subroutine must be included in the same file as the calling program.

The program of an independent separate file can be called from various programs and commonly used.

If a series of work is organized as a unit of a subroutine or another program, the same contents do not have to be described repeatedly. This is effective for correcting descriptions, reducing the creation time and otherwise improving the ease of reading programs.

Procedure name

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. "#Include" is a command to read a designated file from other program files.
For details, refer to "#Include"of PROGRAMMER'S MANUAL.

ID : 5227

<< Prev        Next >>