35 Introduction To 4gl
Introduction
INFORMIX-4GL is a fourth-generation programming language that is used for the development of database applications with a character-based interface.
INFORMIX-4GL provides all the standard constructs of third-generation languages plus two data structures:
- Record: Collection of members in which each member can have any valid Informix data type
- Array: Data structure of up to three dimensions of values of the same data type.
Compiled or Rapid Development System
Two versions:
- INFORMIX-4GL: Compiled version
- INFORMIX-4GL Rapid Development System (RDS): Interpreted version
The Process of Creating Programs
- Design your program
- Create an ASCII file for each screen form
- Compile each form
- Create an ASCII file for each source code module
- Compile each module
- Define and compile the complete program
- Test, debug and correct both syntax and logic.
Suffix | Contents |
---|---|
per | Form source code |
4gl | Module source code |
err | Error file for both forms and modules |
frm | Compiled screen form |
4go | Interpreted module p-code |
o | Compiled module object |
4gi | Interpreted program p-code |
4ge | Compiled program |
c | C code source equivalent to 4GL source |
ec | intermediate C source fiel |
erc | Object error |
pbr | Form source code backup |
fbm | Form object backup |
4bl | Module source code backup |
4bo | Object backup |
4be | Program backup |
4db | Debugger initialization file |
The Development Environment
Two interfaces:
- Menu-Driven Environment: Command i4gl
- The Command-Line Environment: Command form4gl
The Debugger: Command fgldb
Basic Language Features
Comments: # or with —.
Multiple lines comment: { }
User Interaction
- Window: Name rectangular area on the terminal screen
- Forms: Collection of labels and input fields in which the user can input or edit information that is stored in memory on program variables.
- Menus: Menus provide users with a list of actions that, once selectedm perform the task represented by the choise.
Programming Blocks
Types:
- MAIN: only one MAIN block
- FUNCTION
- REPORT
Standard Language Constructs
- Definitions and Declarations: DEFINE, FUNCTION, MAIN ,REPORT
- Flow of Control: CALL, CASE, CONTINUE, END
- 4GL Compiler Directives: DATABASE, DEFER, GLOBALS, WHENEVER
- Storage Management: INITIALIZE, LET, LOCATE, VALIDATE
Screen I/O Language Constructs
The INFORMIX-4GL command set includes a collection of statements designed to facilitate screen and keyboard interactions