Re: [capitalize]

This WebDNA talk-list message is from

2005


It keeps the original formatting.
numero = 63475
interpreted = N
texte = Or, to be more efficient, use a loop to capitalize only the first character of every word. On Nov 24, 2005, at 11:18 AM, Brian Fries wrote: > FYI: The only way I've found to compare case on a word via WebDNA > is through the use of ENCRYPT. > > The WebDNA if/showif comparisons are all case-insensitive, so BOB > is the same as bob. Encrypt, without a specified seed, creates > different values for uppercase letters than lowercase letters, so > the encrypted values can be tested for equality. > > To make this test easy, I have a function called "isUpper": > > [function name=isUpper] > [if "[url][encrypt][params_string][/encrypt][/url]"="[url][encrypt] > [uppercase][params_string][/uppercase][/encrypt][/url]"] > [then][return]1=1[/return][/then] > [else][return]1=0[/return][/else] > [/if] > [/function] > > To test whether a word is all uppercase (or more specifically, > contains no lowercase letters - could contain numbers or > punctuation), I do something like this: > > [listwords words=[mytext]] > [if [isUpper [word]]][then] > [word] is all uppercase > [/then][else] > [word] contains lowercase letters > [/else][/if] > [/listwords] > > > - Brian > > > -- Brian Fries, BrainScan Software -- http:// > www.brainscansoftware.com -- > > On Nov 23, 2005, at 5:13 PM, Patrick McCormick wrote: > >> The all-caps will be random medical acronyms. I suppose I could >> append any words with a uppercase second character as new acronyms >> automatically. >> >> >> On Nov 23, 2005, at 3:57 PM, Stuart Tremain wrote: >> >>> You could do a convert words >>> >>> >>> [Convertwords db=myconversions.db&case=T][Capitalize]my first IRA >>> [/Captialize][/Convertwords] >>> >>> >>> Stuart Tremain >>> idfk web developments, sydney, australia >>> >>> >>> On 22 Nov 2005, at 1:43 AM, Patrick McCormick wrote: >>> >>>> Is there any efficient way to get [capitalize to ignore a series >>>> of capital letters? >>>> >>>> [capitalize]my first IRA[/capitalize] >>>> >>>> would produce "My First IRA" >>>> >>>> as opposed to "My First Ira" > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.com/ > ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: [capitalize] ( Patrick McCormick 2005)
  2. Re: [capitalize] ( Brian Fries 2005)
  3. Re: [capitalize] ( Patrick McCormick 2005)
  4. Re: [capitalize] ( Stuart Tremain 2005)
  5. [capitalize] ( Patrick McCormick 2005)
  6. Minor Bug(?) with [Capitalize] context ( 1999)
  7. Re: [Capitalize] (Dave MacLeay 1998)
  8. Re: [Capitalize] (Kenneth Grome 1998)
Or, to be more efficient, use a loop to capitalize only the first character of every word. On Nov 24, 2005, at 11:18 AM, Brian Fries wrote: > FYI: The only way I've found to compare case on a word via WebDNA > is through the use of ENCRYPT. > > The WebDNA if/showif comparisons are all case-insensitive, so BOB > is the same as bob. Encrypt, without a specified seed, creates > different values for uppercase letters than lowercase letters, so > the encrypted values can be tested for equality. > > To make this test easy, I have a function called "isUpper": > > [function name=isUpper] > [if "[url][encrypt][params_string][/encrypt][/url]"="[url][encrypt] > [uppercase][params_string][/uppercase][/encrypt][/url]"] > [then][return]1=1[/return][/then] > [else][return]1=0[/return][/else] > [/if] > [/function] > > To test whether a word is all uppercase (or more specifically, > contains no lowercase letters - could contain numbers or > punctuation), I do something like this: > > [listwords words=[mytext]] > [if [isUpper [word]]][then] > [word] is all uppercase > [/then][else] > [word] contains lowercase letters > [/else][/if] > [/listwords] > > > - Brian > > > -- Brian Fries, BrainScan Software -- http:// > www.brainscansoftware.com -- > > On Nov 23, 2005, at 5:13 PM, Patrick McCormick wrote: > >> The all-caps will be random medical acronyms. I suppose I could >> append any words with a uppercase second character as new acronyms >> automatically. >> >> >> On Nov 23, 2005, at 3:57 PM, Stuart Tremain wrote: >> >>> You could do a convert words >>> >>> >>> [Convertwords db=myconversions.db&case=T][capitalize]my first IRA >>> [/Captialize][/Convertwords] >>> >>> >>> Stuart Tremain >>> idfk web developments, sydney, australia >>> >>> >>> On 22 Nov 2005, at 1:43 AM, Patrick McCormick wrote: >>> >>>> Is there any efficient way to get [capitalize to ignore a series >>>> of capital letters? >>>> >>>> [capitalize]my first IRA[/capitalize] >>>> >>>> would produce "My First IRA" >>>> >>>> as opposed to "My First Ira" > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.com/ > ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Patrick McCormick

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:

[ELSEIF] was hideif [x]=1,2,3..: (2003) New WebDNA Example from Olin -- (1998) Trouble with emailer (2000) Questions To Answer (1997) Web Cat not returning html? (2000) Micro-managing External Links (2006) unable to launch acgi in WebCat (1997) WebCat2.0 [format thousands .0f] no go (1997) [WebDNA] Searching for encrypted values (2014) checkout.tpl (1999) Formulas.db not working (2006) Assigning new CART number (1997) [OT] Display Glitch (2004) WebCat2 - Getting to the browser's username/password data (1997) Mozilla/4. and Browser Info.txt (1997) [WebDNA] png support in webDNA (2011) Can't load tmpl files (1997) Advice on MacOS & TCP Connects (2000) upgrading (1997) WebCatalog2 Feature Feedback (1996)