Re: [WebDNA] showif with empty variable

This WebDNA talk-list message is from

2015


It keeps the original formatting.
numero = 112172
interpreted = N
texte = --Apple-Mail=_E16780C3-214E-4041-81B1-BF167548E6B0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii This is what I use [function name=3D?] [!] return T/F based on if a field exists and has a value[/!] [!] incoming variables: the name of the field to be tested i.e. [? = field] [/!] [If = ("[url][interpret][[params_string]][/interpret][/url]"!"%5B[interpret][par= ams_string][/interpret]%5D") & = ("[url][interpret][[params_string]][/interpret][/url]"!"")] [Then][return]T[/return][/Then] [Else][return]F[/return][/Else] [/If] [/function] usage: [showif [? selector]=3DF] [include blank_page.inc] [/showif] > On Mar 13, 2015, at 6:25 PM, Terry Wilson wrote: >=20 > I've never had a problem with this by url'ing the variable if there's = a chance it will contain an exclamation point, equal sign or some other = comparison symbol, which would cause a false comparison. If the variable = is a known quantity, such as a variable you feed it from a form value or = otherwise explicitly set (as it appears to be here), then there's no = need to waste your time with unnecessary [url]ing. Another simpler way = is to reverse the comparison: >=20 >> [showif =3D[selector]] >=20 > This way, even if it is something that could contain problematic = characters, they will come after the =3D and not cause a problem. >=20 > I'm curious if this isn't working, or if you are just wondering out = loud before coding it. >=20 > Terry >=20 > Sent from my iPad >=20 > On Mar 13, 2015, at 3:59 PM, Steve Braun > wrote: >=20 >> Hi All, >> I am having an 'age-old' problem with webDNA. >> I want to use a showif tag with an empty variable. >> I've read some of the archives, but they don't seem to apply. >>=20 >> This works: >> [showif [selector]=3Dhome] [include home_page.inc] [/showif] =20= >> [showif [selector]=3Dlocal] [include local_page.inc] [/showif] = =20 >>=20 >> How do I make this work? >> [showif [selector]=3D] [include blank_page.inc] [/showif] =20 >>=20 >> Thanks for any assistance. >>=20 >> Stephen F Braun >> sbraun1@twcny.rr.com >> --------------------------------------------------------- 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 --Apple-Mail=_E16780C3-214E-4041-81B1-BF167548E6B0 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii This is what I use

[function name=3D?]
[!] = return T/F based on if a field exists and has a value[/!]
[!] incoming variables: the name of the field to be tested = i.e. [? field] [/!]
    [If = ("[url][interpret][[params_string]][/interpret][/url]"!"%5B[interpret][par= ams_string][/interpret]%5D") & = ("[url][interpret][[params_string]][/interpret][/url]"!"")]
        = [Then][return]T[/return][/Then]
    =     [Else][return]F[/return][/Else]
  =   [/If]
[/function]

usage: [showif [? selector]=3DF] = [include blank_page.inc] [/showif]




On Mar 13, 2015, at 6:25 PM, = Terry Wilson <terry@terryfic.com> wrote:

I've never had a = problem with this by url'ing the variable if there's a chance it will = contain an exclamation point, equal sign or some other comparison = symbol, which would cause a false comparison. If the variable is a known = quantity, such as a variable you feed it from a form value or otherwise = explicitly set (as it appears to be here), then there's no need to waste = your time with unnecessary [url]ing. Another simpler way is to reverse = the comparison:

[showif =3D[selector]]

This way, even if it is something that could contain = problematic characters, they will come after the =3D and not cause a = problem.

I'm = curious if this isn't working, or if you are just wondering out loud = before coding it.

Terry

Sent from my = iPad

On Mar 13, 2015, at 3:59 PM, = Steve Braun <sbraun1@twcny.rr.com> wrote:

Hi= All,
I am having an 'age-old' problem with = webDNA.
I want to use a showif tag with an empty = variable.
I've read some of the = archives, but they don't seem to apply.

This works:
[showif = [selector]=3Dhome]    [include home_page.inc]   = [/showif]   
[showif = [selector]=3Dlocal]    [include = local_page.inc]   [/showif]   
How do I make this work?
[showif = [selector]=3D]    [include blank_page.inc]   = [/showif]   

Thanks = for any assistance.

Stephen F Braun
sbraun1@twcny.rr.com
--------------------------------------------------------- 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

= --Apple-Mail=_E16780C3-214E-4041-81B1-BF167548E6B0-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] showif with empty variable (Brian Burton 2015)
  2. Re: [WebDNA] showif with empty variable (Donovan Brooke 2015)
  3. Re: [WebDNA] showif with empty variable (Brian Burton 2015)
  4. Re: [WebDNA] showif with empty variable (Donovan Brooke 2015)
  5. Re: [WebDNA] showif with empty variable (Dan Strong 2015)
  6. Re: [WebDNA] showif with empty variable (Terry Wilson 2015)
  7. Re: [WebDNA] showif with empty variable (Kenneth Grome 2015)
  8. Re: [WebDNA] showif with empty variable (Steve Braun 2015)
  9. Re: [WebDNA] showif with empty variable (Steve Braun 2015)
  10. Re: [WebDNA] showif with empty variable (Kenneth Grome 2015)
  11. Re: [WebDNA] showif with empty variable (Donovan Brooke 2015)
  12. Re: [WebDNA] showif with empty variable (Brian Burton 2015)
  13. Re: [WebDNA] showif with empty variable (Terry Wilson 2015)
  14. Re: [WebDNA] showif with empty variable (Dan Strong 2015)
  15. [WebDNA] showif with empty variable (Steve Braun 2015)
--Apple-Mail=_E16780C3-214E-4041-81B1-BF167548E6B0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii This is what I use [function name=3D?] [!] return T/F based on if a field exists and has a value[/!] [!] incoming variables: the name of the field to be tested i.e. [? = field] [/!] [If = ("[url][interpret][[params_string]][/interpret][/url]"!"%5B[interpret][par= ams_string][/interpret]%5D") & = ("[url][interpret][[params_string]][/interpret][/url]"!"")] [Then][return]T[/return][/Then] [Else][return]F[/return][/Else] [/If] [/function] usage: [showif [? selector]=3DF] [include blank_page.inc] [/showif] > On Mar 13, 2015, at 6:25 PM, Terry Wilson wrote: >=20 > I've never had a problem with this by url'ing the variable if there's = a chance it will contain an exclamation point, equal sign or some other = comparison symbol, which would cause a false comparison. If the variable = is a known quantity, such as a variable you feed it from a form value or = otherwise explicitly set (as it appears to be here), then there's no = need to waste your time with unnecessary [url]ing. Another simpler way = is to reverse the comparison: >=20 >> [showif =3D[selector]] >=20 > This way, even if it is something that could contain problematic = characters, they will come after the =3D and not cause a problem. >=20 > I'm curious if this isn't working, or if you are just wondering out = loud before coding it. >=20 > Terry >=20 > Sent from my iPad >=20 > On Mar 13, 2015, at 3:59 PM, Steve Braun > wrote: >=20 >> Hi All, >> I am having an 'age-old' problem with webDNA. >> I want to use a showif tag with an empty variable. >> I've read some of the archives, but they don't seem to apply. >>=20 >> This works: >> [showif [selector]=3Dhome] [include home_page.inc] [/showif] =20= >> [showif [selector]=3Dlocal] [include local_page.inc] [/showif] = =20 >>=20 >> How do I make this work? >> [showif [selector]=3D] [include blank_page.inc] [/showif] =20 >>=20 >> Thanks for any assistance. >>=20 >> Stephen F Braun >> sbraun1@twcny.rr.com >> --------------------------------------------------------- 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 --Apple-Mail=_E16780C3-214E-4041-81B1-BF167548E6B0 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii This is what I use

[function name=3D?]
[!] = return T/F based on if a field exists and has a value[/!]
[!] incoming variables: the name of the field to be tested = i.e. [? field] [/!]
    [If = ("[url][interpret][[params_string]][/interpret][/url]"!"%5B[interpret][par= ams_string][/interpret]%5D") & = ("[url][interpret][[params_string]][/interpret][/url]"!"")]
        = [Then][return]T[/return][/Then]
    =     [Else][return]F[/return][/Else]
  =   [/If]
[/function]

usage: [showif [? selector]=3DF] = [include blank_page.inc] [/showif]




On Mar 13, 2015, at 6:25 PM, = Terry Wilson <terry@terryfic.com> wrote:

I've never had a = problem with this by url'ing the variable if there's a chance it will = contain an exclamation point, equal sign or some other comparison = symbol, which would cause a false comparison. If the variable is a known = quantity, such as a variable you feed it from a form value or otherwise = explicitly set (as it appears to be here), then there's no need to waste = your time with unnecessary [url]ing. Another simpler way is to reverse = the comparison:

[showif =3D[selector]]

This way, even if it is something that could contain = problematic characters, they will come after the =3D and not cause a = problem.

I'm = curious if this isn't working, or if you are just wondering out loud = before coding it.

Terry

Sent from my = iPad

On Mar 13, 2015, at 3:59 PM, = Steve Braun <sbraun1@twcny.rr.com> wrote:

Hi= All,
I am having an 'age-old' problem with = webDNA.
I want to use a showif tag with an empty = variable.
I've read some of the = archives, but they don't seem to apply.

This works:
[showif = [selector]=3Dhome]    [include home_page.inc]   = [/showif]   
[showif = [selector]=3Dlocal]    [include = local_page.inc]   [/showif]   
How do I make this work?
[showif = [selector]=3D]    [include blank_page.inc]   = [/showif]   

Thanks = for any assistance.

Stephen F Braun
sbraun1@twcny.rr.com
--------------------------------------------------------- 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

= --Apple-Mail=_E16780C3-214E-4041-81B1-BF167548E6B0-- Brian Burton

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:

PIXO Support (1997) WebCat2b15MacPlugin - showing [math] (1997) unsubscribe (2000) WebMerchant 1.6 and SHTML (1997) Running 2 two WebCatalog.acgi's (1996) [append] and SSL (1997) shipcost (1997) RE: protect tag not working (1998) WebCat2b13MacPlugIn - more [date] problems (1997) can we get string variables? (1998) Correct Linux Version for WC 6 (2006) Checkbox question (1997) Autoreturn Submit? (1997) webcat2b12 CGI -- Date comparisons (1997) Protect (1997) WebCat2b13MacPlugin - [math][date][/math] problem (1997) RAM variables (1997) Here we go again... (2006) Maybe minor bug report (1997) listfiles, moving files (1998)