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 thisfunction 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 loopTCOn 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:
I think what you want is thisfunction 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 loopTCOn 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:
Error Log.db --however (1997)
[WebDNA] Feature Request (2013)
quotes and truncating? (1997)
Preventing Safari caching (2003)
[WebDNA] Talklist Archive & Twitter (2009)
search engine friendly URLS (Mac) and Lycos! (1998)
[WebDNA] Can't see were it's wrong.... (2017)
[math] show=F exists? (1997)
Frames and WebCat (1997)
[WebDNA] Emailer breaking format (2015)
[LOOKUP] (1997)
Delete Context - to remove record (1998)
Make sure I understand this??? (1997)
WebCatalog on G3 Macs? (1997)
Problems with upload / WebCat (1998)
Problem 2: Prefs file... (1997)
WebCat cannot handle compatible search parameters? (1997)
WebMerchant - MacAuthorize (1999)
Nested tags count question (1997)
Location of Browser Info.txt file (1997)