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


  • Subject: Re: Saving program variables?
  • From: Pete Hall <pbhall@xxxxxxxxxx>
  • Date: Wed, 08 Aug 2001 20:51:51 -0500

At 16:49 08/08/2001, Rohn Blake wrote:

>...for what seems like (believe it or not) a simpler design approach, I
>want to save all the values of all the variables in my RPG to a user
>space/index. And later... on future calls to the program I want to retrieve
>those values and repopulate all the variables (including variables which
>are field names from database files - repositioning the files for READE is
>not necessary, unless equally simple). *INLR will likely not be set on
>between calls, if it makes a difference.

I used to do something like that when I was converting S36 MRT programs. 
They share all variables that are not in a "Save" data structure. I got all 
of the other variables from the storage usage map and built a data 
structure containing them. I then based the data structure (more or less - 
it was RPG 3) at the start of the user space. The user space, of course, 
was a permanent system object, not in QTEMP. The old MRT programs all used 
the cycle (ugh!), so I added a call to a small MI program at the top of the 
calcs, which executed lock space location, and released the lock at the 
bottom of the calcs, in order to single thread competing invocations of the 
same program across multiple jobs. Initialization of the space by the first 
user was a little challenging, and I had to do some gymnastics to make sure 
that if the program broke, it couldn't leave the space location lock, but 
it worked fine once that was all worked out. Now, about this round rolly 
thingamajiggy with spokes...


Pete Hall
pbhall@execpc.com
http://www.execpc.com/~pbhall/

+---
| This is the MI Programmers Mailing List!
| To submit a new message, send your mail to MI400@midrange.com.
| To subscribe to this list send email to MI400-SUB@midrange.com.
| To unsubscribe from this list send email to MI400-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: dr2@cssas400.com
+---

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.