Re: 3.0 [TEXT] variables
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 20498
interpreted = N
texte = On 10/15/98 4:57 PM, Dave MacLeay so noted...>A simple example would be a form with several checkboxes. Currently there>is a lot of code out there that deals with it like this:>> [Append ...]CheckBox1=[ShowIf>[CheckBox1]=[raw][CheckBox1][/raw]]F[/ShowIf][HideIf>[CheckBox1]=[raw][CheckBox1][/raw]][CheckBox1]&CheckBox2=[ShowIf>[CheckBox2]=[raw][CheckBox2][/raw]]F[/ShowIf][HideIf>[CheckBox2]=[raw][CheckBox2][/raw]][CheckBox2][/Append]>>Every time you want to use a checkbox value, you have to go through the>whole [ShowIf]/[HideIf] routine again. What a drag.I had mentioned something to this effect last week on the subject of adding the information from a large number of radio buttons to a database. If you absolutely *have* to define the T/F value for a checkbox, it could be simplified as:[Append ...]CheckBox1=[ShowIf [CheckBox1]!T]F[/ShowIf][ShowIf [CheckBox1]=T]T[/ShowIf]&CheckBox2=[ShowIf [CheckBox2]!T]F[/ShowIf][ShowIf [CheckBox2]=T]T[/ShowIf][/Append]... resulting in far fewer [raw][variable][/raw] tags which, imho, makes it easier to track -- but I'd agree that it's still a drag : )Another way to consider would be to just do:[Append ...]CheckBox1=[CheckBox1]&CheckBox2=[CheckBox2][/Append]Then, when it comes time to use that information to repopulate a form, or cause some action to occur, just think of it as if the value is 'T' it's true, if it's anything else, it's false.Keeping in mind Grant's recent emphatic closure of the whole default value of undeclared variables subject, I'm *not* getting into *that* whole can of worms again! ; )Rob MarquardtDesigner/Resident WireheadToast Design300 First Avenue North, Suite 150Minneapolis MN 55401612.330.9863 v612.321.9424 fwww.toastdesign.com
Associated Messages, from the most recent to the oldest:
On 10/15/98 4:57 PM, Dave MacLeay so noted...>A simple example would be a form with several checkboxes. Currently there>is a lot of code out there that deals with it like this:>> [Append ...]CheckBox1=[ShowIf>[CheckBox1]=
[raw][CheckBox1][/raw]]F[/ShowIf][HideIf>[CheckBox1]=
[raw][CheckBox1][/raw]][CheckBox1]&CheckBox2=[ShowIf>[CheckBox2]=
[raw][CheckBox2][/raw]]F[/ShowIf][HideIf>[CheckBox2]=
[raw][CheckBox2][/raw]][CheckBox2][/Append]>>Every time you want to use a checkbox value, you have to go through the>whole
[showif]/
[hideif] routine again. What a drag.I had mentioned something to this effect last week on the subject of adding the information from a large number of radio buttons to a database. If you absolutely *have* to define the T/F value for a checkbox, it could be simplified as:[Append ...]CheckBox1=[ShowIf [CheckBox1]!T]F[/ShowIf][ShowIf [CheckBox1]=T]T[/ShowIf]&CheckBox2=[ShowIf [CheckBox2]!T]F[/ShowIf][ShowIf [CheckBox2]=T]T[/ShowIf][/Append]... resulting in far fewer
[raw][variable][/raw] tags which, imho, makes it easier to track -- but I'd agree that it's still a drag : )Another way to consider would be to just do:[Append ...]CheckBox1=[CheckBox1]&CheckBox2=[CheckBox2][/Append]Then, when it comes time to use that information to repopulate a form, or cause some action to occur, just think of it as if the value is 'T' it's true, if it's anything else, it's false.Keeping in mind Grant's recent emphatic closure of the whole default value of undeclared variables subject, I'm *not* getting into *that* whole can of worms again! ; )Rob MarquardtDesigner/Resident WireheadToast Design300 First Avenue North, Suite 150Minneapolis MN 55401612.330.9863 v612.321.9424 fwww.toastdesign.com
Rob Marquardt
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:
math with multiple [founditems] (1999)
Multiple download orders of the same product? (1997)
Progress !! WAS: Trouble with formula.db (1997)
Return records from another (1997)
Re[2]: 2nd WebCatalog2 Feature Request (1996)
MacAuthorize order data fields WAS:How To question... (1997)
Cancel Subscription (1996)
ICVerify problems (2001)
[OT] Search Engine Tips (2003)
Text data with spaces in them... (1997)
Summing fields (1997)
Modifying order output (1997)
Alternating colors (1997)
required fields (1999)
[UPPERCASE] (1997)
Last version of webcatalog (2001)
Merry Christmas (1999)
WebCat2_Mac RETURNs in .db (1997)
Search/sort in URL Was: GuestBook example (1997)
Re:2nd WebCatalog2 Feature Request (1996)