|
Thanks for all the input. Let me add this to the mix.
Let's talk about fields initialized with a value. Like below.
D Print s Like( @Button )
Inz( 'Print' )
/Free
If @Button = Print;
Do_something;
EndIf;
/End-Free
Compared to this.
/Free
If @Button = 'Print';
Do_something;
EndIf;
/End-Free
What I like about the first example over the second is validation. If I
compare 10 different fields to Print, I'm guaranteed that each field will
be
comparing for the value of (Print). But if I use the second example to
compare 10 different fields to the value of ('Print'), then the only
guarantee that I have is that the field will only be compared to the value
that I typed in 10 times. In the first example, if I type If @Button =
Prnt, the compiler will kick it out as an error. In the second example,
if
I type it like this If @Button = 'Prnt' or like this If @Button = 'print',
the only indication I'll get that there is a problem is when the program
doesn't work as expected and I'll have to debug it.
Kent Hohlen
Eagle Window And Door
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.