` Printed Icetips Article

Icetips Article



ABC: Filtering with code in ABC templates
1997-10-20 -- Richard Knowley
 
>if SelectZipcode and SelectZipcode <> recordZipcode then exit.
>if SelectState and selectstate <> recordstate then exit.
>if status and selectstatus <> status then exit.
>if overcreditcheck and creditlimit-(bal1+bal2+bal3)  => 0 then exit.
>
>and so on .... very legible and very easy to modify later on.  But as the
>ABC templates go, we seem to lose this VERY valuable ease of programming by
>putting all the code in a function somewhere else without any access to the
>needed data.

This is exactly the kind of code I was using also.  It turns out to be
very similar using the ABC templates under CW4b2.

I was in the right embed point, I just wasn't returning the right
value.  It turns out you have to return Record:Filtered or Record:Ok.
So the above code turns into:

If SelectZipcode and SelectZipcode <> recordZipcode
  return(Record:Filtered)
End

If SelectState and selectstate <> recordstate
  return(Record:Filtered)
End

(more checks here)

Return(Record:Ok)

This was very easy to convert my old code to, and worked like a charm.
The guys on the topspeed forum on Compuserve gave me the scoop to make
it work.

Richard Knowley



Printed November 21, 2024, 10:51 am
This article has been viewed/printed 35372 times.
Google search has resulted in 26 hits on this article since January 25, 2004.