Solved

Proper Case Question - State Abbreviation

Posted on 2011-09-30
6
625 Views
Last Modified: 2013-12-18
I use a formula in Notes (version 5) to display address information on documents in the following format:

2215 Sanders Road, 0581796
Northbrook, Il 60062
(800) 111-2222
(800) 333-4444 Fax

The formula is:

@ProperCase(PHP_ADR_LN1) + ",  " + @ProperCase(LOC_CD) +
@NewLine + @ProperCase(PHP_ADR_LN2) +
@NewLine + TEM_CBK_PHN_NB +
@NewLine + TEM_FAX_NB + "  " + "Fax"

The PHP_ADR_LN2 component contains the City, State and Zip Code information.  What I need to do is to display the state abbreviation in UPPER Case while leaving the rest of the information in PROPER case.  

Assuming that I don't ask the data provider to modify their format, how should I approach this problem?

Thanks in advance for your help

Mike
0
Comment
Question by:BulldogMike
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 36893020
This should do it.  Just set the value variable to your PHP_ADR_LN2 variable.

value := "city, state zip";
stateZip := @RightBack(value; ", ");
city := @LeftBack(value; ", ");
state := @LeftBack(stateZip; " ");
zip := @RightBack(stateZip; " ");
@ProperCase(city) + ", " + @UpperCase(state) + " " + zip
0
 

Author Comment

by:BulldogMike
ID: 36893373
Hi

Sorry I am a beginning programer and I lack the experience of many people who use this sight.  This is how I modified the code based on your answer and it errors out requesting "an operator or a semicolon was expected but none was found".

Please advise it appears I don't understand how to set the value variable to the PHP_ADR_LN2 variable

value := "city, state zip";
PHP_ADR_LN2 = value;
stateZip := @RightBack(value; ", ");
city := @LeftBack(value; ", ");
state := @LeftBack(stateZip; " ");
zip := @RightBack(stateZip; " ");
@ProperCase(city) + ", " + @UpperCase(state) + " " + zip

@ProperCase(PHP_ADR_LN1) + ",  " + @ProperCase(LOC_CD) +
@NewLine + @ProperCase(value) +
@NewLine + TEM_CBK_PHN_NB +
@NewLine + TEM_FAX_NB + "  " + "Fax"
0
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 36893564
No problem, here ya go...

value := PHP_ADR_LN2;
stateZip := @RightBack(value; ", ");
city := @LeftBack(value; ", ");
state := @LeftBack(stateZip; " ");
zip := @RightBack(stateZip; " ");
@ProperCase(city) + ", " + @UpperCase(state) + " " + zip
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Accepted Solution

by:
Bill-Hanson earned 500 total points
ID: 36893583
FYI: That will give you just the formatted City, State Zip format.

For your entire formula, you would use this...


value := PHP_ADR_LN2;
stateZip := @RightBack(value; ", ");
city := @LeftBack(value; ", ");
state := @LeftBack(stateZip; " ");
zip := @RightBack(stateZip; " ");
formattedCityStateZip := @ProperCase(city) + ", " + @UpperCase(state) + " " + zip;

@ProperCase(PHP_ADR_LN1) + ",  " + @ProperCase(LOC_CD) +
@NewLine + formattedCityStateZip +
@NewLine + TEM_CBK_PHN_NB +
@NewLine + TEM_FAX_NB + "  " + "Fax";
0
 

Author Comment

by:BulldogMike
ID: 36893708
Bill

Your code looks good

Got any idea why my code below errors out now and requests a semicolon or an operator where the 2nd parenthese is of (PHP_ADR_LN1) statement - I don't see a problem with this coding.  Is it confusing PHP_ADR_LN1 with PHP_ADR_LN2?
 
@ProperCase(PHP_ADR_LN1) + ",  " + @ProperCase(LOC_CD) +
@NewLine + value +
@NewLine + TEM_CBK_PHN_NB +
@NewLine + TEM_FAX_NB + "  " + "Fax"

Thanks

Mike
0
 

Author Closing Comment

by:BulldogMike
ID: 36893739
Very helpful expert
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question