Solved

Proper Case Question - State Abbreviation

Posted on 2011-09-30
6
624 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
  • 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

808 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