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



... and how does it relate to the rpg programmer.

An rpg data struct is an object.  When the data struct is declared LIKEDS
another struct, the programmer is instantiating the LIKEDS struct.

A proc whose function is to perform some action on a data struct is an
object oriented proc.

So the following is object oriented programming, rpg style:

** the order struct template
d tp_order          ds                    qualified
d  CustNbr                        7a
d  OrderNbr                       7a
d  QtyOrdered                     7p 0
d  QtyShipped                     7p 0

** instantiate the order struct
d order             ds                     likeds(tp_order)

** ------------------------  order_Init -----------------------------
** order_Init - initialize the order struct
d order_Init        pr
d  OutOrder                                likeds(tp_order)

** -------------------------- order_Print ---------------------------
** order_Print - print the order
d order_Print       pr
d  InOrder                                 likeds(tp_order)

 /free
  // initialize the order object
      order_Init( order ) ;

  // print the order object
      order_Print( order ) ;
 /end-free

The only difference between this and C++ is the placement of the name of the
object.
   rpg:   order_Print( order ) ;
   c++:   order.Print( ) ;

heresy?

-Steve Richter




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.