[ic] ITL functions

jeff at hisgirlfridays.com jeff at hisgirlfridays.com
Thu Sep 15 21:23:08 EDT 2005


On Thu, Sep 15, 2005 at 06:45:47PM -0600, Brian J. Miller wrote:

> It is very similar to a standard server side include, only it
> interpolates for ITL as well.  Technically it isn't like a function
> where you could pass arguments, and receive a return value, but not sure
> the ITL you are copying and pasting would need to do that anyways.
> Everything that is normally available to the ITL is still available.

That's exactly it, I do want to pass parameters in.  The return results I can do without,
I can just set something in scratch if need be.  I can do that for passing parameters in
also, except it starts to look weird.  Or maybe it doesn't, now that I am thinking about
it it starts to look like setting class properties before executing a method call, so
maybe it isn't so bad.  I use includes fairly extensively in the manner you describe and I
can probably use tmp scratch vars to pass data in and out now without feeling like a goon.

db.sql="select * from foo where bar=1"
db.execute()
if db.error != 0 print "oops"

[tmp db_sql]select * from foo where bar=1[/tmp]
[tmp db_method]execute[/tmp]
[include file="includes/db"]
[if scratch db_error != 0]
	oops
[/if]

Interesting, although I'd feel weird knowing that db was being included a zillion times.  
I am thinking that it might be possible for the db include to save all of its code in a 
scratch var, so you'd go something like:

[include file="includes/db"]

[tmp db_sql]select * from foo where bar=1[/tmp]
[tmp db_method]execute[/tmp]
[tag interpolate=1][scratch db][/tag]
[if scratch db_error != 0]
        oops
[/if]

Some interesting concepts, I am fascinated by how much capability plain ITL offers.

Thanks,
Jeff


More information about the interchange-users mailing list