Nested Calls
Richard D. Williams
richard at appgrp.net
Thu May 3 10:59:01 PDT 2018
I've been reading this thread for sometime now. Here's my two cents.
I have never used "chain". I never had a use for it.
I use "calls" all the time. As stated previously, they allow us to
modularize, (spell check says this is not a word, but I am using it anyway)
our code and keep tables from getting too big and cumbersome.
"Calls" can also keep you from upsetting the apple cart when making
changes to some unrelated task.
Calls also return to to the original table when you started, no need to
re-position your programming point.
I think "chain"would have huge control issues.
I just like the "call" command.
Remember, you can call processing tables from any filepro file.
So you could have a library of prc.tables you could call from anywhere.
Oddly enough, I do have one for Lat/Long Distance calculation I use all
the time.
Richard D. Williams
BTW I do not know how this thread got to clickable links. I will have
to re-read.
On 5/2/2018 7:41 PM, Jose Lerebours via Filepro-list wrote:
>
>
> On 05/02/2018 07:27 PM, Fairlight via Filepro-list wrote:
>> On Wed, May 02, 2018 at 07:06:49PM -0400, Jose Lerebours via
>> Filepro-list thus spoke:
>>> Again, I can see calling one or two tables but the use of "nested"
>>> and wonder about how deep you can go gives me pause and wonder why
>>> one would need more than two or three ... I have written very large
>>> and very complex filePro application and never needed more than one,
>>> perhaps because I adopted to the handicap back then.
>> Let's say you have a routine which deals with latitude and longitude
>> conversion. You make a prc.latlonconv to do your conversion tasks.
>>
>> Now let's say you have always needed this from input processing. That's
>> fine.
>>
>> One day, you write a new routine which is called from input. Let's say
>> it's prc.newtask. Unfortunately for you, you need "newtask" to
>> actually do
>> some "latlonconv" work. So simply CALL it from inside "newtask". Oh
>> -wait-! You can't! Why? Because you've already CALLed "newtask" from
>> input, so you're one level deep already. Prior to 5.6, that one
>> level deep
>> is all you got.
>>
>> To do what you need to do, you need...wait for it... NESTED CALLS.
>>
>> As we have said already, nested calls let you use one universal chunk of
>> code -from anywhere-. This means from zero levels deep, or 20 levels
>> deep.
>> Doesn't matter, it just works.
>>
>> If you have trouble wrapping your mind around the lat/lon example (just
>> something I pulled out of thin air), imagine something more practical
>> like
>> a custom logging routine. You have a routine which will append a log
>> line to a centralised file, which also maintains the file as a rolling
>> ring buffer, so your disk doesn't fill up. All you need to do is set a
>> variable and call your routine, and it handles the hard work of logging
>> -and- keeping your size constraint constant. You -could- use it to
>> debug
>> your code product-wide with one unified interface, if you have nested
>> calls. Without those, you can't do that without replicating the
>> majority
>> of the logging code in every table where you want to use it. Not exactly
>> plug-and-play modular, in that case.
>>
>> mark->
>
> Mark, at the OS or Sys Admin level I tip my hat to you ... as a
> developer, well, you wont get same respect from me.
>
> Having had experience writing OO and Procedural code, I fully
> understand the benefits of "nested calls", I still believe that there
> should be little to need to nest so deep that you need to concern
> yourself with "how deep can I go?".
>
> News watching time ... I'm out!
>
>
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
>
>
>
> ---
> This email has been checked for viruses by AVG.
> http://www.avg.com
>
>
More information about the Filepro-list
mailing list