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:
 
Re1000001: Setting up shop (1997)
 
Problems appending to database (1997)
 
[include ...] behavior (1997)
 
Follow-Up to:  Removing [showif] makes a big difference in speed (1997)
 
does summ effect blank fields? (1998)
 
[defined]ish (1997)
 
SiteEdit NewFile.html ? (1997)
 
Install Webcatalog under NT4.0 and Microsoft IIS 2.0 (1997)
 
Newbie problem blah blah blah (1997)
 
Base64 encryption limitations?  (1999)
 
Multiple prices (1997)
 
[WebDNA] Admin Login Required to Serve any TPL Page (2009)
 
b12 cannot limit records returned and more. (1997)
 
What am I missing (1997)
 
pop up building with summarize (1998)
 
Ampersand (1997)
 
Authorize.net, SIM, tcpconnect and applescript (2003)
 
Sample Tearoom Search Error (1998)
 
Document Contains No Data! (1997)
 
NT or Mac (1998)