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:

Summing fields (1997) Displaying photo attached to first record (1997) Setting Cart value (2000) Robots fill event log (1997) Bug Report, maybe (1997) RE: WebCat: Access denied, but why? - The solution. (1997) WebDNA-Talk Digests (1997) [WebDNA] Which is more efficient? New db or add to existing db (2013) Looking up two prices in database? (1997) OK, here goes... (1997) Uh...can someone help me out with the b10? (1997) change the number format (1997) Occasional crashes with $remove (1997) shell problems again... (2003) NT BETA BUG???? (1997) Here we go again...WebDNA - SQL- Clustering (2006) Problems appending to database (1997) searchable list archive (1997) Sku numbers (1997) Extended [ConvertChars] (1997)