Re: WebCat2 - [format thousands]

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 10579
interpreted = N
texte = >>What would you think of a new function that would remove all non-numeric >>characters ... except for one or more predefined characters which we as >>webmasters can set in the WebCatalog Prefs file? This would give us more >>control over numeric formatting, similar to the way we can preformat the >>date and time entries now. > >That sounds like a good idea. Perhaps not a function, but perhaps an >input form modifier that tell WebCatalog the incoming number should be a >number. Sounds like a good addition to 2.1Yes, I think this would be a very useful basic implementation of some new text manipulation features.I was thinking more about this since I sent my original message. Panorama has a very useful feature called 'change' which can change any part of a string which appears in a specified field - and it makes these changes to the defined text string in every record of the database - instantly.In WebDNA, there might be two different applications for this type of [change] feature. One would be to manipulate all the values in a database field like Panorama does, for example:[changeData db=xxx&fieldName=description&find=a&changeTo=e] <-- this would work like 'replace' in that it would act on every matching value in the database ... but instead of replacing the entire value in a particular field, it would only change 'part' of the data in that field.The other way to use this feature (or a similar feature) would be to make a change on a single value instead of changing every value in a database field. I think this is what you were referring to above when you said it should be an input form modifier. For example:[changeText a=e]batter[/change] <-- would result in betteror ...[changeText er=]singer[/change] <-- would result in singor ...[changeText ,=]$1,234,567.89[/change] <-- would result in $1234567.89It would even be cooler to do a whole bunch of changes at once, like this:[changeText a=i&r=t&e=ti&b=s]barbell[/change] <-- would result in sitstillor ...[changeText ,=&$=&.=]$1,234,567.89[/change] <-- would result in 123456789The only character you couldn't change using this type of feature would be the & sign. In a numbers-only field, a useful variation on 'change' would be 'removeOtherText' which would remove all characters or strings (except for the pre-defined characters or strings), for example:[removeOtherText 0 1 2 3 4 5 6 7 8 9 .]$345,221.79[/removeOtherText] <--would result in 345221.79Or you could pre-define this particularly useful text manipulation as follows ...[removeOtherText float]$345,221.79[/removeOtherText] <--would result in 345221.79Here are some more pre-defined 'text funnel' examples ...[removeOtherText alpha]Ken$1,239.17[/removeOtherText] <--would result in Ken[removeOtherText integer.]Ken$1,239.17[/removeOtherText] <--would result in 1239In the example above, the dot after the integer parameter would tell WebCat2 what to 'look for' as the decimal separator. If there were no decimal separator defined, then the result would be 123917 ... and if the decimal separator were a comma instead of a dot, the results would be 1.In the case of this example using an 'integer' parameter, WebCat2 would identify everything after the last 'decimal separator' in the string - and the last decimal separator itself - as superfluous, so it would all be discarded before the 'removeOtherText' function would be applied.I guess there could be any number of pre-defined text funnels defined ... but the basics could be covered reasonably well with just the basic two [changeText] and [removeOtherText] contexts.These two new tools alone would create a LOT of flexibility when inputting data. They would probably be most useful in number fields where searching can be problematic unless all the values have a consistent format. But I'm sure other uses will be found for them as well. I can think of one on my site right now ... but I don't think I should go into that on this list.I think I've said enough about these text manipulation possibilities for now. If Grant or anyone else on the list thinks some of these things might be valuable additions to the WebDNA language, please, let's discuss them so we can encourage WebCat2 to become everything we want and need it to be ... :)Sincerely, Ken ------------------------------------ To leave this talk list send an email to macjordomo@smithmicro.com with BODY unsubscribe WebDNA-Talk ------------------------------------ Associated Messages, from the most recent to the oldest:

    
  1. Re: WebCat2 - [format thousands] (Kenneth Grome 1997)
  2. Re: WebCat2 - [format thousands] (Grant Hulbert 1997)
  3. Re: WebCat2 - [format thousands] (Kenneth Grome 1997)
  4. Re: WebCat2 - [format thousands] (Grant Hulbert 1997)
  5. WebCat2 - [format thousands] (Kenneth Grome 1997)
>>What would you think of a new function that would remove all non-numeric >>characters ... except for one or more predefined characters which we as >>webmasters can set in the WebCatalog Prefs file? This would give us more >>control over numeric formatting, similar to the way we can preformat the >>date and time entries now. > >That sounds like a good idea. Perhaps not a function, but perhaps an >input form modifier that tell WebCatalog the incoming number should be a >number. Sounds like a good addition to 2.1Yes, I think this would be a very useful basic implementation of some new text manipulation features.I was thinking more about this since I sent my original message. Panorama has a very useful feature called 'change' which can change any part of a string which appears in a specified field - and it makes these changes to the defined text string in every record of the database - instantly.In WebDNA, there might be two different applications for this type of [change] feature. One would be to manipulate all the values in a database field like Panorama does, for example:[changeData db=xxx&fieldName=description&find=a&changeTo=e] <-- this would work like 'replace' in that it would act on every matching value in the database ... but instead of replacing the entire value in a particular field, it would only change 'part' of the data in that field.The other way to use this feature (or a similar feature) would be to make a change on a single value instead of changing every value in a database field. I think this is what you were referring to above when you said it should be an input form modifier. For example:[changeText a=e]batter[/change] <-- would result in betteror ...[changeText er=]singer[/change] <-- would result in singor ...[changeText ,=]$1,234,567.89[/change] <-- would result in $1234567.89It would even be cooler to do a whole bunch of changes at once, like this:[changeText a=i&r=t&e=ti&b=s]barbell[/change] <-- would result in sitstillor ...[changeText ,=&$=&.=]$1,234,567.89[/change] <-- would result in 123456789The only character you couldn't change using this type of feature would be the & sign. In a numbers-only field, a useful variation on 'change' would be 'removeOtherText' which would remove all characters or strings (except for the pre-defined characters or strings), for example:[removeOtherText 0 1 2 3 4 5 6 7 8 9 .]$345,221.79[/removeOtherText] <--would result in 345221.79Or you could pre-define this particularly useful text manipulation as follows ...[removeOtherText float]$345,221.79[/removeOtherText] <--would result in 345221.79Here are some more pre-defined 'text funnel' examples ...[removeOtherText alpha]Ken$1,239.17[/removeOtherText] <--would result in Ken[removeOtherText integer.]Ken$1,239.17[/removeOtherText] <--would result in 1239In the example above, the dot after the integer parameter would tell WebCat2 what to 'look for' as the decimal separator. If there were no decimal separator defined, then the result would be 123917 ... and if the decimal separator were a comma instead of a dot, the results would be 1.In the case of this example using an 'integer' parameter, WebCat2 would identify everything after the last 'decimal separator' in the string - and the last decimal separator itself - as superfluous, so it would all be discarded before the 'removeOtherText' function would be applied.I guess there could be any number of pre-defined text funnels defined ... but the basics could be covered reasonably well with just the basic two [changeText] and [removeOtherText] contexts.These two new tools alone would create a LOT of flexibility when inputting data. They would probably be most useful in number fields where searching can be problematic unless all the values have a consistent format. But I'm sure other uses will be found for them as well. I can think of one on my site right now ... but I don't think I should go into that on this list.I think I've said enough about these text manipulation possibilities for now. If Grant or anyone else on the list thinks some of these things might be valuable additions to the WebDNA language, please, let's discuss them so we can encourage WebCat2 to become everything we want and need it to be ... :)Sincerely, Ken ------------------------------------ To leave this Talk List send an email to macjordomo@smithmicro.com with BODY unsubscribe WebDNA-Talk ------------------------------------ Kenneth Grome

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:

Date Time Oddness (1999) WebCatalog NT beta 18 now available (1997) Re:listfiles-looking for slick solution (1997) Bug Report, maybe (1997) Customer login feature (2004) Multithreading of [replace] (1999) Quit revisited (1997) Summing fields (1997) Running _every_ page through WebCat ? (1997) This message couldn't reach the list! (multi-column (1998) Almost a there but..bye bye NetCloak (1997) Re:WebCat hosting sites? (1998) URGENT: WebCatalog 2.0 (1998) RE: Shopping Cart Questions (1998) Unusual characters in the db ... (2002) WebCat2 several catalogs? (1997) ISP Billing Software (2001) mapping fields between databases (2001) strange math (2004) [WebDNA] fastcgi 7+ & [cart]? (2010)