Difference between revisions of "Recital 4GL Basics"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 1: Line 1:
 
+
==Commands==
Recital/4GL statements can be entered in a free-form fashion.  Spaces and indents can be added where required to make the code more readable.  Commands can be entered in upper, lower or mixed case and in almost all instances, only the first four letters of a command need be entered, e.g.
+
Recital 4GL commands can be entered in a free-form fashion.  Spaces and indents can be added where required to make the code more readable.  Commands can be entered in upper, lower or mixed case and in almost all instances, only the first four letters of a command need be entered, e.g.
  
 
<code lang="recital">
 
<code lang="recital">
Line 17: Line 17:
 
!Symbol||Position||Effect
 
!Symbol||Position||Effect
 
|-
 
|-
|*||Start of line||Line is ignored
+
|[[*]]||Start of line||Line is ignored
 +
|-
 +
|[[NOTE]]||Start of line||Line is ignored
 
|-
 
|-
|//||Anywhere in line||All text that follows is ignored
+
|[[//]]||Anywhere in line||All text that follows is ignored
 
|-
 
|-
|&&||Anywhere in line||All text that follows is ignored
+
|[[&&]]||Anywhere in line||All text that follows is ignored
 
|-
 
|-
 +
|[[Comment Block|/* */]]||
 
|}
 
|}
  

Revision as of 14:50, 24 March 2009

Commands

Recital 4GL commands can be entered in a free-form fashion. Spaces and indents can be added where required to make the code more readable. Commands can be entered in upper, lower or mixed case and in almost all instances, only the first four letters of a command need be entered, e.g.

MODIFY STRUCTURE
MODI STRU
SET EXCLUSIVE ON
SET EXCL ON


Comments

Comments are ignored by the compiler but are, of course, very useful to the developer and even more so to anyone who has to maintain or alter the code later in its lifetime.


Symbol Position Effect
* Start of line Line is ignored
NOTE Start of line Line is ignored
[[//]] Anywhere in line All text that follows is ignored
&& Anywhere in line All text that follows is ignored
/* */


Line Continuation

The semi-colon ";" placed at the end of a line can be used to continue a command onto the next line. Commands can be up to 8192 characters long.

use customer;
in 1;
order customer

Is the equivalent of:

use customer in 1 order customer


Multiple Commands

By contrast, a semi-colon within a line signifies the end of a command and that the text that follows is a new command.

select 1; use customer; set order tag customer

Is the equivalent of:

select 1
use customer
set order tag customer