Re: _ in front of field name
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 18910
interpreted = N
texte = The primary reason the database helper adds an underscore to the field name in a form is so it can use the [formvariables] context to quickly loop through all the incoming variables (by setting name=_&exact=f as parameters to the context). By using [getchars] to get rid of the leading _, it can easily append or replace the fields as well. The actual name of the fields do not have the underscore in front.John.>This certainly makes sense. But I would swear the database helper did it >for creative database names too.>>Is there documentation on this _ thing? Is there a list of reserved words?>>>>>At 13:31 Uhr 15.07.1998, Sue Ann Sanders wrote:>>>What is the significance of a _ in front of the field names within a>>>form? I believe this was done automatically when I used the database>>>helper.?>>>>It is a good idea to have a naming convention to avoid equal names for>>fields and WebCat commands. Imagine you name a field of your form date>>for the birthday. If you ask for this field on the following page, you>>write for example:>>Since you are born on [date] you are too old...>>In this case WebCat will NOT insert the form field but todays date because>>[date] is a command!>>>>So, if you name all form fields and variables according to such a naming>>convention, you will never make a similar mistake. That is why you see>>often names like [_date], [v.email] or similar in the code of other people.>>>>Peter>>>>__________________________________________>>Peter Ostry - po@ostry.com - www.ostry.com>>Ostry & Partner - Ostry Internet Solutions>>Auhofstrasse 29 A-1130 Vienna Austria>>fon ++43-1-8777454 fax ++43-1-8777454-21>> John A. Hill, V.P. Marketing Pacific Coast SoftwareeCommerce / Web Developer Tools http://www.smithmicro.com
Associated Messages, from the most recent to the oldest:
The primary reason the database helper adds an underscore to the field name in a form is so it can use the
[formvariables] context to quickly loop through all the incoming variables (by setting name=_&exact=f as parameters to the context). By using
[getchars] to get rid of the leading _, it can easily append or replace the fields as well. The actual name of the fields do not have the underscore in front.John.>This certainly makes sense. But I would swear the database helper did it >for creative database names too.>>Is there documentation on this _ thing? Is there a list of reserved words?>>>>>At 13:31 Uhr 15.07.1998, Sue Ann Sanders wrote:>>>What is the significance of a _ in front of the field names within a>>>form? I believe this was done automatically when I used the database>>>helper.?>>>>It is a good idea to have a naming convention to avoid equal names for>>fields and WebCat commands. Imagine you name a field of your form date>>for the birthday. If you ask for this field on the following page, you>>write for example:>>Since you are born on
[date] you are too old...>>In this case WebCat will NOT insert the form field but todays date because>>
[date] is a command!>>>>So, if you name all form fields and variables according to such a naming>>convention, you will never make a similar mistake. That is why you see>>often names like [_date], [v.email] or similar in the code of other people.>>>>Peter>>>>__________________________________________>>Peter Ostry - po@ostry.com - www.ostry.com>>Ostry & Partner - Ostry Internet Solutions>>Auhofstrasse 29 A-1130 Vienna Austria>>fon ++43-1-8777454 fax ++43-1-8777454-21>> John A. Hill, V.P. Marketing Pacific Coast SoftwareeCommerce / Web Developer Tools http://www.smithmicro.com
John Hill
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:
PCS Frames (1997)
Credit card types (1997)
No Access warning when caching HTML files (1997)
WebCat Documentation (was [platform] tag?) (1998)
pass a captured value (2004)
OT: 800x600 (2003)
Multiple prices (1997)
Webcatalog error, Plug-in for Webstar (1996)
Questions To Answer (1997)
bug in [SendMail] (1997)
WebCat cannot handle compatible search parameters? (1997)
WebCatalog stalls (1998)
Possible Hijacking from Globix (2002)
Move WebDNA DB to MySQL (2005)
Virtual hosting and webcatNT (1997)
problem: type 2 errors (1997)
wired [protect] action? (1998)
PCS Frames (1997)
Caching [include] files ... (1997)
[WebDNA] Two file tags don't work as expected (2009)