Difference between revisions of "Category:CLP"

From MidrangeWiki
Jump to: navigation, search
(Reorganized CLP)
Line 1: Line 1:
'''CLP''' is an acronym which stands for {{bu|C|ontrol}} {{bu|L|anguage}} {{bu|P|rogramming}} language.
+
{{AN}} is an acronym for {{bu|C|ontrol}} {{bu|L|anguage}} {{bu|P|rogram}}.
  
 +
Much of what we find in CLP programs are IBM Commands. [http://wiki.midrange.com/index.php/Category:Commands]  Also see [[CLP Coding Rules]] and [[:Category:Commands]].
 +
 +
As with many other languages, there are multiple versions in popular usage, such as [[CLP/400]] and [[ILE-CLP]].
 +
 +
In some realities, this is comparable to software that is the "glue" connecting higher level language programs like [[:RPG]]; data base files and their over-rides; screen and print "files" and their over-rides; and other objects with Menus ... typically when we take a menu option, we are launching a CLP program.
 +
 +
== CLP Unique Commands ==
 +
 +
Some 400 [[:Category:Commands | commands]] can ONLY be executed from within a CLP program, not from [[Command Line]].  In other programming languages, these might be called OP CODES.
 +
* [[PGM]] (Program)
 +
* [[ENDPGM]]
 +
* [[DCL]] (Declare Variable)
 +
* [[IF]]
 +
* [[ELSE]]
 +
* [[DO]]
 +
* [[ENDDO]]
 +
* [[GOTO]]
 +
* [[MONMSG]]
 +
 +
== Special characters ==
 +
Some characters have special meaning in CL:
 +
 +
{| class="wikitable" border="1"
 +
! Symbol !! Meaning
 +
|-
 +
| align="center"|<nowiki>||</nowiki> || *CAT
 +
|-
 +
| align="center"|<nowiki>|></nowiki> || *BCAT
 +
|-
 +
| align="center"|<nowiki>|<</nowiki> || *TCAT
 +
|-
 +
| align="center"|<nowiki>=</nowiki> || *EQ
 +
|-
 +
| align="center"|<nowiki>></nowiki> || *GT
 +
|-
 +
| align="center"|<nowiki><</nowiki> || *LT
 +
|-
 +
| align="center"|<nowiki>>=</nowiki> || *GE
 +
|-
 +
| align="center"|<nowiki><=</nowiki> || *LE
 +
|-
 +
| align="center"|<nowiki>¬=</nowiki> || *NE
 +
|-
 +
| align="center"|<nowiki>¬></nowiki> || *NG
 +
|-
 +
| align="center"|<nowiki>¬<</nowiki> || *NL
 +
|-
 +
| align="center"|<nowiki>&</nowiki> || *AND
 +
|-
 +
| align="center"|<nowiki>|</nowiki> || *OR
 +
|-
 +
| align="center"|<nowiki>¬</nowiki> || *NOT
 +
|}
 +
 +
Ref: CL Programming, Expressionsin CL commands
 +
 +
== Pointer use ==
 +
As of V5R4, CL allows the use of pointers.  There were some problems with uninitialised pointers, and PTFs were issued.  As of 15 Feb 2008, 5722-SS1:
 +
* SI28620
 +
* SI28196
 +
* SI27953
 +
 +
These are immediate PTFs, but you will need to re-compile any CL programs using pointers in order to get the issues fixed.
 +
 +
One can't compare a pointer to *NULL, but a clever idea is to create an unused pointer (which will be set to *NULL if the above PTFs are applied) and compare to that.  Here is a snippet from Tom L. for a CL program that performs [http://code.midrange.com/1509e4633a.html getenv] from a thread on [http://archive.midrange.com/rpg400-l/200802/msg00248.html RPG400-L].
 +
 +
dcl &pNull *ptr  /* Auto-initialized to *null */
 +
if ( &pEnvVar *eq &pNull )  do
 +
 +
==Categories==
 
[[Category:Programming languages]]
 
[[Category:Programming languages]]
 +
[[Category:CLP|*]]

Revision as of 14:47, 29 October 2009

CLP is an acronym for Control Language Program.

Much of what we find in CLP programs are IBM Commands. [1] Also see CLP Coding Rules and Category:Commands.

As with many other languages, there are multiple versions in popular usage, such as CLP/400 and ILE-CLP.

In some realities, this is comparable to software that is the "glue" connecting higher level language programs like RPG; data base files and their over-rides; screen and print "files" and their over-rides; and other objects with Menus ... typically when we take a menu option, we are launching a CLP program.

CLP Unique Commands

Some 400 commands can ONLY be executed from within a CLP program, not from Command Line. In other programming languages, these might be called OP CODES.

Special characters

Some characters have special meaning in CL:

Symbol Meaning
|| *CAT
|> *BCAT
|< *TCAT
= *EQ
> *GT
< *LT
>= *GE
<= *LE
¬= *NE
¬> *NG
¬< *NL
& *AND
| *OR
¬ *NOT

Ref: CL Programming, Expressionsin CL commands

Pointer use

As of V5R4, CL allows the use of pointers. There were some problems with uninitialised pointers, and PTFs were issued. As of 15 Feb 2008, 5722-SS1:

  • SI28620
  • SI28196
  • SI27953

These are immediate PTFs, but you will need to re-compile any CL programs using pointers in order to get the issues fixed.

One can't compare a pointer to *NULL, but a clever idea is to create an unused pointer (which will be set to *NULL if the above PTFs are applied) and compare to that. Here is a snippet from Tom L. for a CL program that performs getenv from a thread on RPG400-L.

dcl &pNull *ptr  /* Auto-initialized to *null */
if ( &pEnvVar *eq &pNull )  do

Categories

Subcategories

This category has only the following subcategory.

C