Re: [WebDNA] How to use [function]

This WebDNA talk-list message is from

2012


It keeps the original formatting.
numero = 108657
interpreted = N
texte = This is a multi-part message in MIME format. --------------020903010302050608060606 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Toby, I'm trying to understand in which case I should use the [function] or no= t. Your example is clear, It looks like it would be nice to have all the=20 webdna code in separate files, and have only the result called in the=20 page, that would make page codes clear. for the break/stop the documentation says : "'The*[return]*context does NOT 'break out' of a function call, so it is=20 possible to use one or more*[return]*contexts to 'tailor' the functions=20 output. " Kenneth, how would you use an array with this kind of search function? Thanks Lawrence Toby Cox a =E9crit : > I think what you want is this > > > function as follows (in an include) > > [function name=3DgetResults] > [search db=3Dmydb.db&&neSKUdata=3D[blank]] > [founditems] > [return]
[SKU]-[name]
[/return] > [/founditems] > [showif [numfound]=3D0] > [return]Nothing to see here[/return] > [/showif] > [/search] > [/function] > > > on your page... > > >
> [getResults] >
> > > I think I'm right in saying that unlike JS or PHP, when we use [return]= in webdna it does not break/stop. > > However, if I'm wrong, you would need to nest the founditems in [return= ] and take out [return] from within the founditems loop > > > TC > > On 22 Feb 2012, at 13:15, WebDNA Solutions wrote: > >> If you don't want the results in a specific format, I guess >> you can save the results as variables (or an array) then use >> the variables/array in whatever format you desire. >> >> Sincerely, >> Kenneth Grome >> >> >> >>> Sorry, for the code, (=3D:) that's a typing mistake. >>> If I put the
[SKU]-[name]
in >>> the founditems, ther is no use to put all this in the >>> [function] right? >>> Lawrence >>> >>> WebDNA Solutions a =E9crit : >>>> Your code is bad, you should use =3D not : in your >>>> search, and you should put>>> class"myclass">[SKU]-[name]
inside the >>>> founditems context. >>>> >>>> Sincerely, >>>> Kenneth Grome >>>> >>>>> Hi, >>>>> >>>>> I have been spending hours digging in Govinda great >>>>> job in WebdnaCodeSparker. >>>>> >>>>> I must confess I have never been using the [function] >>>>> and I now wondering how to use it... >>>>> I went thought the doc, it clear to me how to send >>>>> variable to a function that will execute it. >>>>> >>>>> But How to use function with a search contexts? >>>>> exemple : >>>>> >>>>> >>>>> I put the following code in a [function] >>>>> [search mydb.db&neSKUdata:FINDALL] >>>>> [founditems][/founditems] [/search] >>>>> >>>>> And I want to get the result in>>>> class"myclass">[SKU]-[name] >>>>> >>>>> Maybe function is not meant to do this kind of action? >>>>> >>>>> Thanks for help >>>>> >>>>> -Lawrence >>>>> ------------------------------------------------------ >>>>> --- This message is sent to you because you are >>>>> subscribed to the mailing list. >>>>> To unsubscribe, E-mail to: >>>>> archives: http://mail.webdna.us/list/talk@webdna.us >>>>> Bug Reporting: support@webdna.us >>>> ------------------------------------------------------- >>>> -- This message is sent to you because you are >>>> subscribed to the mailing list. >>>> To unsubscribe, E-mail to: >>>> archives: http://mail.webdna.us/list/talk@webdna.us >>>> Bug Reporting: support@webdna.us >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list. >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> Bug Reporting: support@webdna.us > > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list. > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > Bug Reporting: support@webdna.us --------------020903010302050608060606 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Toby,
I'm trying to understand in which case I should use the  [function] or not.
Your example is clear, It looks like it would be nice to have all the webdna code in separate files, and have only the result called in the page, that would make page codes clear.
 for the break/stop the documentation says :
"'The [return] context does NOT 'break out' of a function call, so it is possible to use one or more [return] contexts to 'tailor' the functions output. "

Kenneth,
how would you use an array with this kind of search function?

Thanks
Lawrence



Toby Cox a écrit :
I think what you want is thisfunction as follows (in an include)[function name=getResults]  [search db=mydb.db&&neSKUdata=[blank]]    [founditems]      [return]<div class"myclass">[SKU]-[name]</div>[/return]    [/founditems]    [showif [numfound]=0]      [return]Nothing to see here[/return]    [/showif]  [/search][/function]on your page...<div class="resultsContainer">  [getResults]</div>I think I'm right in saying that unlike JS or PHP, when we use [return] in webdna it does not break/stop.However, if I'm wrong, you would need to nest the founditems in [return] and take out [return] from within the founditems loopTCOn 22 Feb 2012, at 13:15, WebDNA Solutions wrote:
If you don't want the results in a specific format, I guess you can save the results as variables (or an array) then use the variables/array in whatever format you desire. Sincerely,Kenneth Grome
Sorry, for the code, (=:) that's a typing mistake.If I put the <div class="myclass">[SKU]-[name] </div>inthe founditems, ther is no use to put all this in the[function] right?LawrenceWebDNA Solutions a écrit :
Your code is bad, you should use = not : in yoursearch, and you should put<divclass"myclass">[SKU]-[name]</div> inside thefounditems context.Sincerely,Kenneth Grome
Hi,I have been spending hours digging in Govinda greatjob in WebdnaCodeSparker.I must confess I have never been using the [function]and I now wondering how to use it...I went thought the doc, it clear to me how to sendvariable to a function that will execute it.But How to use function with a search contexts?exemple :I put the following code in a [function][search mydb.db&neSKUdata:FINDALL][founditems][/founditems] [/search]And I want to get the result  in<divclass"myclass">[SKU]-[name]</div>Maybe function is not meant to do this kind of action?Thanks for help-Lawrence--------------------------------------------------------- This message is sent to you because you aresubscribed to the mailing list<talk@webdna.us>.To unsubscribe, E-mail to:<talk-leave@webdna.us>archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us
--------------------------------------------------------- This message is sent to you because you aresubscribed to the mailing list<talk@webdna.us>.To unsubscribe, E-mail to:<talk-leave@webdna.us>archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us
---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list <talk@webdna.us>.To unsubscribe, E-mail to: <talk-leave@webdna.us>archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us
---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list <talk@webdna.us>.To unsubscribe, E-mail to: <talk-leave@webdna.us>archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us
--------------020903010302050608060606-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] How to use [function] (Govinda 2012)
  2. Re: [WebDNA] How to use [function] (Donovan Brooke 2012)
  3. Re: [WebDNA] How to use [function] (Banahan 2012)
  4. Re: [WebDNA] How to use [function] (Toby Cox 2012)
  5. Re: [WebDNA] How to use [function] (WebDNA Solutions 2012)
  6. Re: [WebDNA] How to use [function] (Toby Cox 2012)
  7. Re: [WebDNA] How to use [function] (WebDNA Solutions 2012)
  8. Re: [WebDNA] How to use [function] (Banahan 2012)
  9. Re: [WebDNA] How to use [function] (Toby Cox 2012)
  10. Re: [WebDNA] How to use [function] (WebDNA Solutions 2012)
  11. Re: [WebDNA] How to use [function] (Banahan 2012)
  12. Re: [WebDNA] How to use [function] (WebDNA Solutions 2012)
  13. [WebDNA] How to use [function] (Banahan 2012)
This is a multi-part message in MIME format. --------------020903010302050608060606 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Toby, I'm trying to understand in which case I should use the [function] or no= t. Your example is clear, It looks like it would be nice to have all the=20 webdna code in separate files, and have only the result called in the=20 page, that would make page codes clear. for the break/stop the documentation says : "'The*[return]*context does NOT 'break out' of a function call, so it is=20 possible to use one or more*[return]*contexts to 'tailor' the functions=20 output. " Kenneth, how would you use an array with this kind of search function? Thanks Lawrence Toby Cox a =E9crit : > I think what you want is this > > > function as follows (in an include) > > [function name=3DgetResults] > [search db=3Dmydb.db&&neSKUdata=3D[blank]] > [founditems] > [return]
[SKU]-[name]
[/return] > [/founditems] > [showif [numfound]=3D0] > [return]Nothing to see here[/return] > [/showif] > [/search] > [/function] > > > on your page... > > >
> [getResults] >
> > > I think I'm right in saying that unlike JS or PHP, when we use [return]= in webdna it does not break/stop. > > However, if I'm wrong, you would need to nest the founditems in [return= ] and take out [return] from within the founditems loop > > > TC > > On 22 Feb 2012, at 13:15, WebDNA Solutions wrote: > >> If you don't want the results in a specific format, I guess >> you can save the results as variables (or an array) then use >> the variables/array in whatever format you desire. >> >> Sincerely, >> Kenneth Grome >> >> >> >>> Sorry, for the code, (=3D:) that's a typing mistake. >>> If I put the
[SKU]-[name]
in >>> the founditems, ther is no use to put all this in the >>> [function] right? >>> Lawrence >>> >>> WebDNA Solutions a =E9crit : >>>> Your code is bad, you should use =3D not : in your >>>> search, and you should put>>> class"myclass">[SKU]-[name] inside the >>>> founditems context. >>>> >>>> Sincerely, >>>> Kenneth Grome >>>> >>>>> Hi, >>>>> >>>>> I have been spending hours digging in Govinda great >>>>> job in WebdnaCodeSparker. >>>>> >>>>> I must confess I have never been using the [function] >>>>> and I now wondering how to use it... >>>>> I went thought the doc, it clear to me how to send >>>>> variable to a function that will execute it. >>>>> >>>>> But How to use function with a search contexts? >>>>> exemple : >>>>> >>>>> >>>>> I put the following code in a [function] >>>>> [search mydb.db&neSKUdata:FINDALL] >>>>> [founditems][/founditems] [/search] >>>>> >>>>> And I want to get the result in>>>> class"myclass">[SKU]-[name] >>>>> >>>>> Maybe function is not meant to do this kind of action? >>>>> >>>>> Thanks for help >>>>> >>>>> -Lawrence >>>>> ------------------------------------------------------ >>>>> --- This message is sent to you because you are >>>>> subscribed to the mailing list. >>>>> To unsubscribe, E-mail to: >>>>> archives: http://mail.webdna.us/list/talk@webdna.us >>>>> Bug Reporting: support@webdna.us >>>> ------------------------------------------------------- >>>> -- This message is sent to you because you are >>>> subscribed to the mailing list. >>>> To unsubscribe, E-mail to: >>>> archives: http://mail.webdna.us/list/talk@webdna.us >>>> Bug Reporting: support@webdna.us >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list. >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> Bug Reporting: support@webdna.us > > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list. > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > Bug Reporting: support@webdna.us --------------020903010302050608060606 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Toby,
I'm trying to understand in which case I should use the  [function] or not.
Your example is clear, It looks like it would be nice to have all the webdna code in separate files, and have only the result called in the page, that would make page codes clear.
 for the break/stop the documentation says :
"'The [return] context does NOT 'break out' of a function call, so it is possible to use one or more [return] contexts to 'tailor' the functions output. "

Kenneth,
how would you use an array with this kind of search function?

Thanks
Lawrence



Toby Cox a écrit :
I think what you want is thisfunction as follows (in an include)[function name=getResults]  [search db=mydb.db&&neSKUdata=[blank]]    [founditems]      [return]<div class"myclass">[SKU]-[name]</div>[/return]    [/founditems]    [showif [numfound]=0]      [return]Nothing to see here[/return]    [/showif]  [/search][/function]on your page...<div class="resultsContainer">  [getResults]</div>I think I'm right in saying that unlike JS or PHP, when we use [return] in webdna it does not break/stop.However, if I'm wrong, you would need to nest the founditems in [return] and take out [return] from within the founditems loopTCOn 22 Feb 2012, at 13:15, WebDNA Solutions wrote:
If you don't want the results in a specific format, I guess you can save the results as variables (or an array) then use the variables/array in whatever format you desire. Sincerely,Kenneth Grome
Sorry, for the code, (=:) that's a typing mistake.If I put the <div class="myclass">[SKU]-[name] </div>inthe founditems, ther is no use to put all this in the[function] right?LawrenceWebDNA Solutions a écrit :
Your code is bad, you should use = not : in yoursearch, and you should put<divclass"myclass">[SKU]-[name]</div> inside thefounditems context.Sincerely,Kenneth Grome
Hi,I have been spending hours digging in Govinda greatjob in WebdnaCodeSparker.I must confess I have never been using the [function]and I now wondering how to use it...I went thought the doc, it clear to me how to sendvariable to a function that will execute it.But How to use function with a search contexts?exemple :I put the following code in a [function][search mydb.db&neSKUdata:FINDALL][founditems][/founditems] [/search]And I want to get the result  in<divclass"myclass">[SKU]-[name]</div>Maybe function is not meant to do this kind of action?Thanks for help-Lawrence--------------------------------------------------------- This message is sent to you because you aresubscribed to the mailing list<talk@webdna.us>.To unsubscribe, E-mail to:<talk-leave@webdna.us>archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us
--------------------------------------------------------- This message is sent to you because you aresubscribed to the mailing list<talk@webdna.us>.To unsubscribe, E-mail to:<talk-leave@webdna.us>archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us
---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list <talk@webdna.us>.To unsubscribe, E-mail to: <talk-leave@webdna.us>archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us
---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list <talk@webdna.us>.To unsubscribe, E-mail to: <talk-leave@webdna.us>archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us
--------------020903010302050608060606-- Banahan

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:

Upgrade on MacOSX 3.05 to 3.08 (2000) [format 40s]text[/format] doesn't work (1997) WC 2.0 frames feature (1997) Will swap web catalog hosting for some light development (2001) WebCat2b13MacPlugIn - [include] doesn't allow creator (1997) [Announce] DNAAds v1.0 (2003) Encyption mail was Suggestions for Topics ... (1998) Shop till you drop dead on the avenue ... (1997) HELP WITH DATES (1997) Webten + Webcat running smooth (1998) Error page & W2003 -SOLVED (2005) Missing / in generated url (2006) Emailer setup (1997) WC1.6 to WC2 date formatting (1997) One Hour Email (2002) using showpage and showcart commands (1996) Re:WebDNA Writer Needed (1997) URL problem (2007) Updating fields from different platforms (1998) A question about security (1998)