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



To implement undo, in general,

Instead of updating the application state immediately each time, register
individual updates in a "log" or "history" structure, which for example
contains max 20 entries (i.e. max. 10 consecutive undo's supported).
The actual current state is the "old" state with all n updates applied to
it, or with the first (n-m) updates applied. The latter implies that m
"undo's" where applied.
When a new update must be registered and the "log" is full (20 updates
registered) then apply the first 10 updates and remove them from the log.
This makes room for the next 10 updates, and still supports up to 10 undo's.



On Mon, Dec 18, 2017 at 6:15 AM, Nathan Andelin <nandelin@xxxxxxxxx> wrote:

On Sat, Dec 16, 2017 at 8:21 AM, Booth Martin <booth@xxxxxxxxxxxx> wrote:

Is there an repeat-undo process in RPG? Something similar to Ctrl-z in
text editors?


Booth,

You didn't provide any context other than "text editors" for what you may
have meant by "undo". That may have led others besides me to wonder what
half-baked idea you might have had in mind. Thankfully, Buck and Jon
surmised that you were talking about undoing database updates. I'm aware of
a number of valid use-cases for that.

In fact, we provide that for school teachers who are filling out a grades
worksheet. The UI is browser based and the screen looks and behaves a lot
like an Excel worksheet. The columns show all the class assignments and
tests for the year. The rows show all the students in the class. The cells
in the middle contain student-class-assignment grades.

Teachers occasionally need to undo grade values that were keyed into cells.
Every change to a cell is immediately recorded in an IBM i DB table. I
think a product like Google Sheets operates like that too.

At any rate, and as you suspected, we keep track of database changes in an
internal array, and provide an "undo" key that invokes a DB update, a
screen update, and removes the last array entry.

If multiple people were editing the same worksheet at the same time, we
would have to come up with something more entailed in order to accommodate
that. I'd probably have all editors share the same session and keep all the
screens in sync.

The 5250 paradigm is not really geared for that. But I wouldn't have any
problem doing that with the type of plumbing that we have for web browsers.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


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.