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



Y'all

Ever since I started with VB3 in the mid-90s, I've heard about event-driven programming. And I made the leap to, pressing a function key is a kind of event - not all that different from pressing a button in a GUI - and, hey, if you have PCOMM and turn on hotspots, it IS pressing a button in a GUI!!

Windows in those days was a kind of cycle - hey, it really was!! It sent messages in a round-robin kind of thing, and whoever could respond, did. Events were a kind of message - I'm oversimplifying, of course, but it makes enough sense for me.

So a Windows app consisted of a big select-case kind of thing, testing what kinds of messages they wanted to process. Seems the same as most of the display apps I've seen - run a loop until the F3 event occurs, meanwhile process the ones you care about inside the body of the loop.

And RPG is very well-suited for this kind of thing. Even if you DON'T turn off the cycle!

Just for thinking about!
Vern

On 2/21/2012 2:48 PM, Nathan Andelin wrote:
From: Scott Klement
Why do you think RPG is not well suited for event-driven programming?
Dieter and John E. opened themselves up to rebuttal by failing to define what they meant by event-driven programming. And as you've pointed out, events can arise from many different sources; not just GUI components, which they may not have anticipated.

However, I think the traditional meaning of event-driven programming arose from IDE's that provided for drag and drop GUI widgets on various design surfaces, and provided for attaching "functions" to a wide range of onXXX events.

To add event logic, you'd just select the GUI widget in your IDE, then double click on one of the onXXX labels listed in a property sheet. A new code window would open, and the event-handling interface would be automatically generated for you. That was event-driven programming. It was a feature of the IDE.

If that's what we mean by event-driven programming, then I'd suggest that it's a good thing that RPG is NOT well suited for it. We're better off by having RPG as a server language, and for the compiler team to focus on that.

For GUI event programming, I use Dreamweaver, and JavaScript. It would be a waste of time to try to make RPG run in a browser. However, that doesn't mean that RPG shouldn't respond to browser events. We write a lot of RPG code that responds to timer, keypress, mouse click, combo-box change, page load, focus, and other GUI events using asynchronous requests, mostly. And since the response is so quick, it makes the user feel like they're working on a desktop based system, rather than one where most of the event-handling logic is actually running on a server.

-Nathan


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.