On 25 Feb 2017, at 18:29, christophe.billiottet@webdna.us wrote:You =could also use [middle]
[text]myVar=3D_ID:2:firstname[/text]
[middle endbefore=3D:&endcount=3D-1][myVar][/middle]
<br>
[middle =startafter=3D:&endbefore=3D:][myVar][/middle]
<br>
[middle =startafter=3D:&startcount=3D2][myVar][/middle]
to extract the values
- chrisOn Feb 24, 2017, at =21:56, Brian Burton <brian@burtons.com> wrote:
Currently, to parse a complex incoming variable =(_ID:2:firstname) you have to jump thru this hoop
[listwords= delimiters=3D:&words=3D[name]][showif =[index]=3D2][word][/showif][/listwords]
It =would be great if listwords could be told just to kick out one word, =i.e.
[listwords =delimiters=3D:&words=3D[name]&index=3D2][word][/listwords]
my function =solution is:
[function name=3Dgetword]
-- =incoming variables are $string,$D (delimiter),$P (position) --
[return][listwords =delimiters=3D[$D]&words=3D[$string]][showif =[index]=3D[$P]][word][/showif][/listwords][/return]
[/function]
which is even =shorter to use:
[getword =$D=3D:&$P=3D2&$string=3D[name]]
---------------------------------------------------------
This message is sent to you because you are subscribed to
the mailing list <talk@webdna.us>.
To unsubscribe, E-mail =to: <talk-leave@webdna.us>
archives: http://mail.webdna.us/list/talk@webdna.us
Bug= Reporting: support@webdna.us
|
On 25 Feb 2017, at 18:29, christophe.billiottet@webdna.us wrote:You =could also use [middle]
[text]myVar=3D_ID:2:firstname[/text]
[middle endbefore=3D:&endcount=3D-1][myVar][/middle]
<br>
[middle =startafter=3D:&endbefore=3D:][myVar][/middle]
<br>
[middle =startafter=3D:&startcount=3D2][myVar][/middle]
to extract the values
- chrisOn Feb 24, 2017, at =21:56, Brian Burton <brian@burtons.com> wrote:
Currently, to parse a complex incoming variable =(_ID:2:firstname) you have to jump thru this hoop
[listwords= delimiters=3D:&words=3D[name]][showif =[index]=3D2][word][/showif][/listwords]
It =would be great if listwords could be told just to kick out one word, =i.e.
[listwords =delimiters=3D:&words=3D[name]&index=3D2][word][/listwords]
my function =solution is:
[function name=3Dgetword]
-- =incoming variables are $string,$D (delimiter),$P (position) --
[return][listwords =delimiters=3D[$D]&words=3D[$string]][showif =[index]=3D[$P]][word][/showif][/listwords][/return]
[/function]
which is even =shorter to use:
[getword =$D=3D:&$P=3D2&$string=3D[name]]
---------------------------------------------------------
This message is sent to you because you are subscribed to
the mailing list <talk@webdna.us>.
To unsubscribe, E-mail =to: <talk-leave@webdna.us>
archives: http://mail.webdna.us/list/talk@webdna.us
Bug= Reporting: support@webdna.us
DOWNLOAD WEBDNA NOW!
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...