Re: [WebDNA] Issue with including functions

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 107062
interpreted = N
texte = Hi Bill, Donovan's reply is the more interesting avenue to explore.. but in the = name of debugging, ... (below) > First, I tried: >=20 > [function name=3Dinclude_if_exists] > [showif [fileinfo file=3D[file]][exists][/fileinfo]=3DT][return][includ= e > file=3D[file]][/return][/showif] > [/function] >=20 > [include_if_exists file=3D/includes/vendor.inc] >=20 > That did not work because the functions in the included file were (I'm > guessing here) within the namespace of the function > "include_if_exists". OK, that makes sense to me but I'm not sure why > the included text did not appear either. That part seemed strange. When I try this: ------------------- START TestDumpInc.inc ------------------------ [function name=3Dfn_longLiveTheKing] [return]We Love the King[/return] [/function][!]---fn_longLiveTheKing---[/!] The King is Living Long! ------------------- END TestDumpInc.inc ------------------------ [function name=3Dinclude_if_exists] [showif [fileinfo = file=3D[file]][exists][/fileinfo]=3DT][return][include = file=3D[file]][/return][/showif] [/function] [include_if_exists file=3DTestDumpInc.inc] ... then I get just this in the browser: The King is Living Long! So it seems to me the expected result (unlike what you reported). > Then I tried: >=20 > [function name=3Dfile_exists?] > [return]"[fileinfo [file]][exists][/fileinfo]"=3D"T"][/return] > [/function] >=20 > [showif [file_exists? file=3D/includes/vendor.inc]][include > file=3D/includes/vendor.inc][/showif] this ^^^ also failed for me.. and looks like it *should* work.. but when = I try to isolate the breaking point.. it seems that we are not yet = allowed to get too tricky inside a [showif..] comparison statement.. = (that we HAVE to keep the comp. char hard coded?).. because, anyway, = when I do this: [function name=3Dfile_exists?] [return][fileinfo [file]][exists][/fileinfo][/return] [/function] [showif T=3D[file_exists? file=3DTestDumpInc.inc]] [include file=3DTestDumpInc.inc] [/showif] ...then I get this back: The King is Living Long! - Govinda -------------- Old WebDNA talklist archives: http://dev.webdna.us/TalkListArchive/index.tpl?db=3Dwebdna-talk Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Issue with including functions (Govinda 2011)
  2. Re: [WebDNA] Issue with including functions (Donovan Brooke 2011)
  3. [WebDNA] Issue with including functions (William DeVaul 2011)
Hi Bill, Donovan's reply is the more interesting avenue to explore.. but in the = name of debugging, ... (below) > First, I tried: >=20 > [function name=3Dinclude_if_exists] > [showif [fileinfo file=3D[file]][exists][/fileinfo]=3DT][return][includ= e > file=3D[file]][/return][/showif] > [/function] >=20 > [include_if_exists file=3D/includes/vendor.inc] >=20 > That did not work because the functions in the included file were (I'm > guessing here) within the namespace of the function > "include_if_exists". OK, that makes sense to me but I'm not sure why > the included text did not appear either. That part seemed strange. When I try this: ------------------- START TestDumpInc.inc ------------------------ [function name=3Dfn_longLiveTheKing] [return]We Love the King[/return] [/function][!]---fn_longLiveTheKing---[/!] The King is Living Long! ------------------- END TestDumpInc.inc ------------------------ [function name=3Dinclude_if_exists] [showif [fileinfo = file=3D[file]][exists][/fileinfo]=3DT][return][include = file=3D[file]][/return][/showif] [/function] [include_if_exists file=3DTestDumpInc.inc] ... then I get just this in the browser: The King is Living Long! So it seems to me the expected result (unlike what you reported). > Then I tried: >=20 > [function name=3Dfile_exists?] > [return]"[fileinfo [file]][exists][/fileinfo]"=3D"T"][/return] > [/function] >=20 > [showif [file_exists? file=3D/includes/vendor.inc]][include > file=3D/includes/vendor.inc][/showif] this ^^^ also failed for me.. and looks like it *should* work.. but when = I try to isolate the breaking point.. it seems that we are not yet = allowed to get too tricky inside a [showif..] comparison statement.. = (that we HAVE to keep the comp. char hard coded?).. because, anyway, = when I do this: [function name=3Dfile_exists?] [return][fileinfo [file]][exists][/fileinfo][/return] [/function] [showif T=3D[file_exists? file=3DTestDumpInc.inc]] [include file=3DTestDumpInc.inc] [/showif] ...then I get this back: The King is Living Long! - Govinda -------------- Old WebDNA talklist archives: http://dev.webdna.us/TalkListArchive/index.tpl?db=3Dwebdna-talk Govinda

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Email Destination Folder Question (2004) [ModDate] & [ModTime] ? (1997) shipCost not working v2.1b4 (1997) suffix mapping for NT? (1997) Forms Search Questions (1997) I'm having trouble using [url][interpret][math] together inlookup (1997) Bug Report, maybe (1997) New Command prefs ... (1997) [ShowNext] feature in 2.0 (1997) That Flakey 'Brawl' thing (1997) WC Database Format (1997) RE: Re:Has this happened to you? (1997) upgrading (1997) More on the email templates (I like it) (1997) WC2.0 Memory Requirements (1997) Installed 4.5 but indicates 4.50rc2 (2002) Search for dates greater than [date] (1997) Cart ID (1999) A link and two command (1998) [WebDNA] [append] does not add the newline char at the end of the new record?! (which can causes subsequent [search] to fail.) (2009)