View previous topic :: View next topic
|
Author |
Message |
kavyareddy
New User
Joined: 13 Dec 2008 Posts: 2 Location: Hyderabad
|
|
|
|
can anyone let me know the differences between the modes in Natural? i.e. the differences between Structured and reporting mode
2)According to the perfomance wise which is better either an external subroutine or a sub program & why? |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
The last chapter of Natural's "Programming Guide" book is called "Reporting Mode and Structured Mode". It covers the differences between the two modes from several points of view.
If you have specific question regarding the issue, please post it here.
For your second question: The is no documented comparison between Natural's Subprogram and Natural's external Subroutine - performance-wise. From my experience, there is no such difference and it is up to your flavour of coding. |
|
Back to top |
|
|
monasu1998
Active User
Joined: 23 Dec 2005 Posts: 176 Location: India
|
|
|
|
Hi Kavya,
For your 2nd question here are my comments
External subroutine can access the GDAs where as the subroutines can not access Globals.
kavyareddy wrote: |
can anyone let me know the differences between the modes in Natural? i.e. the differences between Structured and reporting mode
2)According to the perfomance wise which is better either an external subroutine or a sub program & why? |
|
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
He was asking about performance... not variable usage...
O. |
|
Back to top |
|
|
Ralph Zbrog
New User
Joined: 21 Nov 2009 Posts: 58 Location: California
|
|
|
|
In this case, variable usage has a direct effect on performance.
Have you ever seen a subprogram call without a parameter list? Unlikely. The CALLNAT statement allows up to 40 parameters and rarely do you see a subprogram without one. When the CALLNAT is executed, Natural checks the lists in the caller and the subprogram to verify that the parameters match in number, format, and length - this is overhead.
What if all the parameters were located in the GDA of the caller? In that case you could change the subprogram to an external subroutine, declare the GDA in the subroutine, and remove the parameter list, thereby eliminating the overhead.
A GDA is a much more efficient way of "passing" data than a parameter list, because the GDA is already available to the called routine - there is nothing to pass. |
|
Back to top |
|
|
|