× 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.



Hi Bruce,

I haven't put the request in yet. It's on my list of things to do. I meant to do it last week and I'm now meaning to do it this week. :) I don't know if there's a way to sign support, but maybe additional requests that reflect the same want could be helpful.

However, your example can be done with a constant. Here's a sample program:

D true C '1'
D counter S 3u 0
/free

DoW true;
counter += 1;
If counter = 10;
Leave;
EndIf;
EndDo;

*inlr = *on;

/end-free

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Bruce Guetzkow
Sent: Tuesday, April 21, 2009 9:01 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: Data Structure Constant

Kurt:

<snip>
I have a data structure and I'd like for its contents to never be changed, enforced by the compiler. How do I do this?
</snip>

Just wondering...have you submitted a formal request for this to IBM? I've thought of another scenario that seems to apply...

Consider the following code:

dou forever;
exfmt screen;
select;
when fkey = F3;
leave;
when fkey = enter;
prcenter();
endsl;
enddo;

The above is just a rough sketch of a way to process screen input: Read a screen "forever", processing the enter key each time it is pressed, exiting when F3 is pressed.

In order to do this "forever" must be a Boolean expression or indicator. Normally I define a standalone variable (type "N") and set the value to *OFF. I never change the value of the field "forever". However, like your scenario, someone could come along at a later date, not understand how "forever" is used, and set "forever" to some other value (like *ON). I'd like to define "forever" as a constant, but then I can't use it in the "dou" statement. Having a READONLY keyword which can be used against DS or standalone field would be ideal.

Of course, since any Boolean will do, you could always do something like: "dou 'A' <> 'A'", but that seems less obvious.

If you've already submitted a request, is there a way for us to add our support?

Thanks in advance,
--Bruce Guetzkow



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.