Re: [WebDNA] tag [validcard] fails on webdna 7.0. Do I need the commerce edition?
This WebDNA talk-list message is from 2011
It keeps the original formatting.
numero = 106399
interpreted = N
texte = On Mar 21, 2011, at 8:59 AM, Tom Duke wrote:> Brian,>=20> Hi - nice function. I'm curious as to why you use '1=3D1' and '1=3D0' =for your true/false outputs.>=20> - Tom>=20If you set a 1=3D1 and 1=3D0, evaluate as true and false within any =[if], [showif] or [hideif]. By returning these values, I can use the =simple syntax examples:[if [ccValid =85]][then]good stuff[/then][else]bad stuff[/else][/if][showif [ccValid =85]]good stuff[/showif][hideif [ccValid =85]]bad stuff[/hideif]I use this technique throughout my code, commonly with global text =variables set:[text]true=3D1=3D1[/text][text]false=3D1=3D0[/text]Then I can do things like this:[text]foundIt=3D[false][/text][listwords words=3D[listofwords]][showif [word]=3D[whatIWant]][text]foundIt=3D[true][/text][/showif=][/listwords][if [foundIt]][then]do the stuff[/then][else]do the other stuff][/else][/if]With good variable names, it makes the code very readable. For me, it's =much cleaner than testing for "T" or "F" values.Brian FriesBrainScan Software
Associated Messages, from the most recent to the oldest:
On Mar 21, 2011, at 8:59 AM, Tom Duke wrote:> Brian,>=20> Hi - nice function. I'm curious as to why you use '1=3D1' and '1=3D0' =for your true/false outputs.>=20> - Tom>=20If you set a 1=3D1 and 1=3D0, evaluate as true and false within any =
[if],
[showif] or
[hideif]. By returning these values, I can use the =simple syntax examples:[if [ccValid =85]][then]good stuff[/then][else]bad stuff[/else][/if][showif [ccValid =85]]good stuff[/showif][hideif [ccValid =85]]bad stuff[/hideif]I use this technique throughout my code, commonly with global text =variables set:
[text]true=3D1=3D1[/text]
[text]false=3D1=3D0[/text]Then I can do things like this:
[text]foundIt=3D[false][/text][listwords words=3D[listofwords]][showif [word]=3D[whatIWant]]
[text]foundIt=3D[true][/text][/showif=][/listwords][if [foundIt]][then]do the stuff[/then][else]do the other stuff][/else][/if]With good variable names, it makes the code very readable. For me, it's =much cleaner than testing for "T" or "F" values.Brian FriesBrainScan Software
Brian Fries
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:
Converting DOS database (2000)
[WebDNA] WebDNA & Google Chrome Browser (2012)
Testing the WebCat Email List Members (2000)
[WebDNA] ONLY the FIRST continuous run of numeric chars? (2008)
refreshing IE with posted .tmpl (1997)
If Empty ? (1997)
Paths (2000)
WebCatalog 2.0 & WebDNA docs in HTML ... (1997)
problems with 2 tags shakur (1997)
Fun with dates (1997)
Credit Card Number Stripping Digit (1997)
Help needed! (SIMS recommendation) (1998)
[OT] DOD again (2003)
RE: Displaying Location (1997)
[shownext max=?] armed (1997)
Max Record length restated as maybe bug (1997)
HomePage Caution (1997)
WebDNA dying or ... ? (2005)
[shell]? (2000)
problem with WebDNA Command (2004)