chain from @wlf
Brian K. White
brian at aljex.com
Fri Apr 15 12:05:06 PDT 2005
----- Original Message -----
From: "Fairlight" <fairlite at fairlite.com>
To: "filePro Mailing List" <filepro-list at lists.celestial.com>
Sent: Friday, April 15, 2005 2:49 PM
Subject: Re: chain from @wlf
> The honourable and venerable Joe Chasan spoke thus:
>> fp 5.0.14, unix.
>>
>> Is anyone using chain command successfully from @wlf while within
>> update on a record within *clerk?
>>
>> I have a table that works by itself, works when chain'ed from @key,
>> yet if i chain to it from within update on a record from @wlf, within
>> the chain'ed to table clerk is completely confused as to what line #'s
>> it should be executing, going to lines that are never referenced,
>> executing partial subroutines, or giving SegV's.
>>
>> I had though this was working for a while, I don't see in docs anywhere
>> that says can't chain from within update...
>
> Disclaimer: I have not seen the fP source code, and these are educated
> guesses.
>
> That said, it seems like a fairly safe assumption from a logical point of
> view that you're confusing the table handler by -where- you're triggering
> it.
>
> I was under the impression that chain was used primarily in the early days
> to get around table length limitations. I've been told that it basically
> -replaces- the table that made the chain call with the target of said
> call.
>
> If you have event triggers like @key, @wlf's, @wef's, etc., and you
> -replace- the table in memory, you were at a place in memory while
> executing those, and those places just got overwritten--or at the very
> least the pointers are no longer to the correct locations for various
> events. So any WHEN processing events you had coded should, from a
> logical
> point of view, completely vanish and become null and void. I'd say it
> might make sense if it was programmed to pick up on new WHEN processing in
> the new table, but I somehow don't think they anticipated someone chaining
> out of an event and nuking all their triggers in event-handler.
>
> Best guess, but I think you're probably corrupting memory by using it for
> something it was probably never intended for.
I thought chain was something Howie simply decreed must exist way back when
he could make such decrees, and I thought he used it primarily as a way to
modularize code when no other means existed. It can be used to make code
even more modular than even call tables can do now. The trick is to chain
back to where you came from, or more accurately, to write tables that are
meant to be chained into and out of and depending on the programs needs, may
end, or chain somewhere else, including back where you just came from. This
gets around the inability to nest call tables while still llowing code that
is as modular and reuseable as call tables and gosubs. It does certainly get
around table length limits too though.
Brian K. White -- brian at aljex.com -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO Prosper/FACTS AutoCAD #callahans Satriani
More information about the Filepro-list
mailing list