Re: searching with if/then
This WebDNA talk-list message is from 2004
It keeps the original formatting.
numero = 58052
interpreted = N
texte = Aside from the numerous other posts already (and sorry if this suggestion has come up already)...my suggestion would be to take the if/else/then out of the search string itself. Personally, I would resolve the if/else/then above the search string and deposit the results into a textvar that you could then populate the search string with.(rough example):[showif [fontsrch]=T] [text show=f]GROUPONEIS=[Url]nohtml+fontname+foundry+fampkg+[/Url][/text][/showif][showif [fontsrch]=F] [If ("[famsrch]"="T")] [Then][text show=f]GROUPONEIS=[url]&eqFAMDISPdatarq=T[/url][/text][/Then] [Else][text show=f]GROUPONEIS=[Url][math show=F]err=0,err_num=0[/math][/Url][/text][/Else] [/If][/showif][search db=../../www.philsfonts.com/vault/philsfonts.db[!][/!][showif [keyword]!]&[wrd]GROUP1datarq=[keyword]&GROUP1FIELD=[GROUPONEIS][!][/!]&etc......[/search]Note, and not sure if Donovan pointed this out in his post where he broke down the entire string, but your IF/THEN logic doesn't fit. You have:[/!][showif [keyword]!]&[wrd]GROUP1datarq=[keyword]&GROUP1FIELD=[!]...snip..[/!][If(([fontsrch]=F)&([famsrch]=T))][Then]&eqFAMDISPdatarq=T[/Then][/If][!]which if the conditions are met, you're saying &GROUP1FIELD=&eqFAMDISPdatarq=TNote also, and I think this came up before and not sure what the consensus was, but for the IF statement, I've found it necessary to put the quote marks around the conditions.GKAt 06:57 PM 5/24/2004, you wrote:>Hello all,>>First post ever!>>Anybody know why the heck this isn't working... I can explain more if>needed:>>[search db=../../www.philsfonts.com/vault/philsfonts.db[!]>[/!][showif [keyword]!]&[wrd]GROUP1datarq=[keyword]&GROUP1FIELD=[!]>[/!][If(([fontsrch]=T)&([famsrch]=T))][Then]nohtml+fontname+foundry+famp >kg+[/Then][/If][!]>[/!][If(([fontsrch]=T)&([famsrch]=F))][Then]nohtml+fontname+foundry+famp >kg+[/Then][/If][!]>[/!][If(([fontsrch]=F)&([famsrch]=T))][Then]&eqFAMDISPdatarq=T[/Then][/ If][!]>[/!][If(([fontsrch]=F)&([famsrch]=F))][Then][math>show=F]err=0,err_num=0[/math][/Then][/If][!]>[/!][showif>[foundrystring]!]&woFOUNDRYdatarq=[foundrystring]&FOUNDRYword=sw&FOUNDRY >wbrk=,[/showif][!]>[/!][showif [designer]!]&eqDESIGNERdatarq=[designer][/showif][!]>[/!][showif>[classstring]!]&woCLASSIFICATIONdatarq=[classstring]&CLASSIFICATIONword= >sw&CLASSIFICATIONwbrk=,[/showif][!]>[/!]&MANOPTsort=1&MANOPTtype=text&MANOPTsdir=de&FONTNAMEsort=2&FONTNAMEt >ype=text&FONTNAMEsdir=as&VOLPKGNUMsort=3&FONTNAMEsumm=T&startat=[startat >]&max=[rslts]][/showif][/search]>>>Not sure if this is the right way to phrase this but... we're trying to>assign the different search parameters with various if/then conditional>statements and some [showif]'s. Not working. When we try to access the>[founditems] later on in the code, it's telling me it can't because>there is no search context. This was an experiment. So it may be way>off. Just thought I'd check. Thanks for any help!>>Jon-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
Aside from the numerous other posts already (and sorry if this suggestion has come up already)...my suggestion would be to take the if/else/then out of the search string itself. Personally, I would resolve the if/else/then above the search string and deposit the results into a textvar that you could then populate the search string with.(rough example):[showif [fontsrch]=T] [text show=f]GROUPONEIS=[url]nohtml+fontname+foundry+fampkg+[/Url][/text][/showif][showif [fontsrch]=F] [If ("[famsrch]"="T")] [Then][text show=f]GROUPONEIS=[url]&eqFAMDISPdatarq=T[/url][/text][/Then] [Else][text show=f]GROUPONEIS=[url][math show=F]err=0,err_num=0[/math][/Url][/text][/Else] [/If][/showif][search db=../../www.philsfonts.com/vault/philsfonts.db[!][/!][showif [keyword]!]&[wrd]GROUP1datarq=[keyword]&GROUP1FIELD=[GROUPONEIS][!][/!]&etc......[/search]Note, and not sure if Donovan pointed this out in his post where he broke down the entire string, but your IF/THEN logic doesn't fit. You have:[/!][showif [keyword]!]&[wrd]GROUP1datarq=[keyword]&GROUP1FIELD=[!]...snip..[/!][If(([fontsrch]=F)&([famsrch]=T))][Then]&eqFAMDISPdatarq=T[/Then][/If][!]which if the conditions are met, you're saying &GROUP1FIELD=&eqFAMDISPdatarq=TNote also, and I think this came up before and not sure what the consensus was, but for the IF statement, I've found it necessary to put the quote marks around the conditions.GKAt 06:57 PM 5/24/2004, you wrote:>Hello all,>>First post ever!>>Anybody know why the heck this isn't working... I can explain more if>needed:>>[search db=../../www.philsfonts.com/vault/philsfonts.db[!]>[/!][showif [keyword]!]&[wrd]GROUP1datarq=[keyword]&GROUP1FIELD=[!]>[/!][If(([fontsrch]=T)&([famsrch]=T))][Then]nohtml+fontname+foundry+famp >kg+[/Then][/If][!]>[/!][If(([fontsrch]=T)&([famsrch]=F))][Then]nohtml+fontname+foundry+famp >kg+[/Then][/If][!]>[/!][If(([fontsrch]=F)&([famsrch]=T))][Then]&eqFAMDISPdatarq=T[/Then][/ If][!]>[/!][If(([fontsrch]=F)&([famsrch]=F))][Then][math>show=F]err=0,err_num=0[/math][/Then][/If][!]>[/!][showif>[foundrystring]!]&woFOUNDRYdatarq=[foundrystring]&FOUNDRYword=sw&FOUNDRY >wbrk=,[/showif][!]>[/!][showif [designer]!]&eqDESIGNERdatarq=[designer][/showif][!]>[/!][showif>[classstring]!]&woCLASSIFICATIONdatarq=[classstring]&CLASSIFICATIONword= >sw&CLASSIFICATIONwbrk=,[/showif][!]>[/!]&MANOPTsort=1&MANOPTtype=text&MANOPTsdir=de&FONTNAMEsort=2&FONTNAMEt >ype=text&FONTNAMEsdir=as&VOLPKGNUMsort=3&FONTNAMEsumm=T&startat=[startat >]&max=[rslts]][/showif][/search]>>>Not sure if this is the right way to phrase this but... we're trying to>assign the different search parameters with various if/then conditional>statements and some [showif]'s. Not working. When we try to access the>[founditems] later on in the code, it's telling me it can't because>there is no search context. This was an experiment. So it may be way>off. Just thought I'd check. Thanks for any help!>>Jon-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Gary Krockover
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:
What am I missing (1997)
Weird error/limit - something amiss? (1997)
Pirated WebCat? NOT... (2003)
[carts] and databases (1997)
Great product and great job ! (1997)
Secure server question (1997)
Multihoming and webcat (1998)
WebCat2: Items xx to xx shown, etc. (1997)
Foreign Chars ( יאצה and so on) (1998)
To Do list (2003)
Fwd: mondomail and Webcat (2000)
WebCat2b13 Command Reference Doc error (1997)
WebDNA Solutions ... sorry! (1997)
Sendmail Woes (2002)
Multiple TCPConnects (2002)
How to set triggers (1998)
redirect question (2001)
Re[2]: Field Problem (2000)
Re:How to Display text in empty fields (1997)
taxTotal (1997)