From be139a9bd362a496d412586edda178d7113cd1ac Mon Sep 17 00:00:00 2001 From: barry <3708366+worksofliam@users.noreply.github.com> Date: Wed, 15 Nov 2023 11:11:05 -0500 Subject: [PATCH] Note about member text --- docs/pages/developing/local/structure.md | 48 ++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/docs/pages/developing/local/structure.md b/docs/pages/developing/local/structure.md index 2cfc270..5b651bb 100644 --- a/docs/pages/developing/local/structure.md +++ b/docs/pages/developing/local/structure.md @@ -1,5 +1,53 @@ This page outlines a recommended project structure when using git with your ILE sources. Code for IBM i and subsequent extensions will follow this structure for local development. +## File names & 'member text' + +It is recommended the name of the source matches the name of the created object. For example + +* `ord500.pgm.rpgle` would become the `ORD500.PGM` object +* `ord500.cmd` would become the `ORD500.CMD` object + +Since member text is traditionally associated with members, it is not longer possible to do that with the standard hirearchial file system. There are two options for associating 'text' (the description) with a piece of source code. + +### Using `%TEXT` in your source + +You can use `%TEXT:` in any comments in your source code. This works for any programming language you use. + +```rpgle +**free + +// %TEXT: This program is for order entry + +dcl-pi ORD500; +end-pi; + +//... + +return; +``` + +```sql +-- %TEXT: Order entry table +create or replace table xyz (...); +``` + +### Using `TEXT` option (in RPGLE) + +In the H-spec or `CTL-OPT` operation code, you can use the `TEXT` keyword to specify the text. + +```rpgle +**free + +ctl-opt text('This program is for order entry'); + +dcl-pi ORD500; +end-pi; + +//... + +return; +``` + ## Lowercase file names It is recommend to always use lowercase file names. Generally, it is easier on the eyes and follows the standard of most other environments. You could also consider using camelCase.