Re: [WebDNA] How to use [function]

This WebDNA talk-list message is from

2012


It keeps the original formatting.
numero = 108656
interpreted = N
texte = 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=20 > you can save the results as variables (or an array) then use=20 > the variables/array in whatever format you desire.=20 >=20 > Sincerely, > Kenneth Grome >=20 >=20 >=20 >> 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 >>=20 >> 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. >>>=20 >>> Sincerely, >>> Kenneth Grome >>>=20 >>>> Hi, >>>>=20 >>>> I have been spending hours digging in Govinda great >>>> job in WebdnaCodeSparker. >>>>=20 >>>> 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. >>>>=20 >>>> But How to use function with a search contexts? >>>> exemple : >>>>=20 >>>>=20 >>>> I put the following code in a [function] >>>> [search mydb.db&neSKUdata:FINDALL] >>>> [founditems][/founditems] [/search] >>>>=20 >>>> And I want to get the result in>>> class"myclass">[SKU]-[name] >>>>=20 >>>> Maybe function is not meant to do this kind of action? >>>>=20 >>>> Thanks for help >>>>=20 >>>> -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 >>>=20 >>> ------------------------------------------------------- >>> -- 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 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)
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=20 > you can save the results as variables (or an array) then use=20 > the variables/array in whatever format you desire.=20 >=20 > Sincerely, > Kenneth Grome >=20 >=20 >=20 >> 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 >>=20 >> 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. >>>=20 >>> Sincerely, >>> Kenneth Grome >>>=20 >>>> Hi, >>>>=20 >>>> I have been spending hours digging in Govinda great >>>> job in WebdnaCodeSparker. >>>>=20 >>>> 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. >>>>=20 >>>> But How to use function with a search contexts? >>>> exemple : >>>>=20 >>>>=20 >>>> I put the following code in a [function] >>>> [search mydb.db&neSKUdata:FINDALL] >>>> [founditems][/founditems] [/search] >>>>=20 >>>> And I want to get the result in>>> class"myclass">[SKU]-[name] >>>>=20 >>>> Maybe function is not meant to do this kind of action? >>>>=20 >>>> Thanks for help >>>>=20 >>>> -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 >>>=20 >>> ------------------------------------------------------- >>> -- 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 Toby Cox

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:

WebCat2b13MacPlugIn - [showif][search][/showif] (1997) Platform Switch (1997) Problem with summary on date / inconsequent webcat behaviour (1998) Formulas.db + Users.db (1997) Further tests with the infamous shipCost (1997) [middle] (2000) [format 40s]text[/format] doesn't work (1997) f2 download problems (1997) interesting (2003) [ShowIf] if the varieable exists (1998) DB Field Name? (2000) Upgrade to 3.07 problems (2000) World Address Info (2003) WebCatalog for guestbook ? (1997) Emailer Set Up (1997) Email Spam a bit of Hell (2004) random random links (1999) Upgrade to WebCat2 from Commerce Lite (1997) Multiple fields on 1 input (1997) RE: error count with $purchase (1997)