I've been trying to figure out what BIND means, and the docs have been more confusing than helpful.
Taking a stab in the dark, I'm guessing BIND is used to replace the virtual TT/PDS specified by a REFERENCE-ONLY declaration at one end of a caller/callee pair with an actual TT/PDS in the opposing routine when the call is made, and that that replacement persists past the end of the call's return. Maybe?
Ie, could this be considered one way to work-around shared temp-tables, or have multiple OOABL objects work with the same TT/PDS instance?
It reduces the number of separate and independent copies, but it doesn't get us away from having too many objects aware of the data structure.
It reduces the number of separate and independent copies, but it doesn't get us away from having too many objects aware of the data structure.
That's what it accomplishes, but how does it do that?
In other words, how is this thing supposed to be used?
Was my guess right?
http://tinyurl.com/ywfuke
HIH
Salvador
I've been trying to figure out what BIND means, and
the docs have been more confusing than helpful.
Yes, this is a very confusing piece of tagging your parameter, not 4GL-like. Even a 3GL doesn't have that many ways of passing a parameter. I wonder how many people really get what they need when passing parameters, avoiding unnecessary internal copies.
The "bad thing" in ABL is that we still have this automatic bufferscoping in the language. Todays code is not some 1K top-down code anymore, but it's structured using functions/procedures and formal parameter transfer. I have asked several times for a simple temp-table/ProDataSet definition without all this automatic behavior (in todays code with dynamic buffers it's more of a nuisance than a feature) and a simple way to cast a dynamic buffer handle to a static definition. One of the solutions to this problem is this BIND-feature.
As far as I can interpret it, it's like passing a ProDataSet/Temp-Table by refererence, so there will be no copy operation when handing the parameter over to the caller. The bonus will be that it uses the same buffers as the caller. So when you FIND something in the caller, the callee has the same currency. With regular BY-REFERENCE the caller gets it's own bufferscope.
http://tinyurl.com/ywfuke
HIH
Salvador
Nice link Salvador, but these are the docs Tim is complaining about
Personally, I've always had a hard time with the documentation.
Usually the documentation get me more confused then when I started and it's a slow process of figuring it out myself and forming my own opinion.
It's something I'd like to hear other peoples opinion on and possibly suggestion for improvements.
Oops. Sorry about that. ;-(
Oops. Sorry about that. ;-(
I haven't had a chance to look at those links yet. However, even if they did answer my question about what BIND is/does, there's still the root problem, namely that the Programmer's Handbook / Language Reference Guide not clearly explaining some of the more involved / abstract concepts in the language.
On another, more positive note, I've been going through the 10.1B PDS docs, and while I haven't compared it with the prior version docs, I think what I've read so far is a lot better than what I recall reading before. There's even some small code samples showing how to put a PDS together and FILL it!