×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Nice. I have to wonder what the 'g' means.
Our shop standard uses the leading character to identify type, although the
types might seem a little odd for most shops. We have programmers from
multiple disciplines that sometimes need to jump from platform to platform,
so some of our stuff is less I-specific than it would be in other shops.
For example, sCountryName would be a string holding a Country Name, even
though it is technically an Alpha field on the I. We also use the f prefix
(Float) for any numeric with decimal positions, b for boolean, etc. We also
use i for integer, but apply it to any numeric with no decimal positions.
Our "types" are actually more descriptive of how the variable is used
instead of how they are declared.
And not completely unlike your gYes example, in our global copybook we
define true and false as constants. Especially in free-form I think
true/false reads better that *on/*off or '1'/'0'. Especially for someone
coming from a non-I background. On that subject, one of my pet peeves is to
see code that puts a value in an indicator that is not equivalent to '0' or
'1'. Just because you can does not mean you should. I wonder how much code
would break if IBM decided to start raising exceptions for invalid values in
an indicator?
Also, on your all upper case query, we use all upper case to signify
externally defined fields, and mixed case for internally defined. Now that
my brain is thinking scope, I now know what the g means! I should have
guessed that a lot earlier :)
--------------------------------------------------
From: "David FOXWELL" <David.FOXWELL@xxxxxxxxx>
Sent: Monday, July 05, 2010 8:30 AM
To: "RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
Subject: rpg constant
Have we a list where we can post amusing pieces of code?
This one made me smile, though on another day I might have cried.
D gYes C 'Y'
then, if myfield = gYes, etc.
1. It has no sense.
2. Its written in English instead of French ( imagine seeing if myfield =
gOui in YOUR code )
3. Isn't it standard to code constants in upper case? It is here.
As an Amazon Associate we earn from qualifying purchases.