How to change first numbers of a telephone number - HELP

Posted by Admin on 06-Oct-2006 04:22

How can I let the first 3 numbers of a telephone number automatic change with Progress-Code? The Remainder should be the same

Example: 041 675 25 69 to 052 675 25 69

Thanks for help.

Greets

All Replies

Posted by svi on 06-Oct-2006 10:01

Assuming the variable that includes the phone numbers is a CHAR, please check the REPLACE function:

http://progress.atgnow.com/esprogress/resultDisplay.do?gotoLink=76&docType=1000&contextId=18850%3A76.152%2C1337.1420%2C395.517&clusterName=CombinedCluster&contentId=9d3145a2-38d0-400c-b462-fa681cad23fe&responseId=a6b23249f80b7ff7%3A1b1fbf4%3A10e1dd27ea8%3A-47a8&groupId=1&answerGroup=1&score=983&page=http%3A%2F%2Fprogress.atgnow.com%2Fesprogress%2Fdocs%2FProgress%2Fesupport.progress.com%2FEDocHTML%2FOpenEdge%2F10.1A%2Fdvref%2Fdvref-14-54.html&result=0&excerpt=REPLACEfunctionReturnsastringwithspecifiedsubstringreplacements.&resultType=5000#Goto76

Posted by Tim Kuehn on 07-Oct-2006 10:09

REPLACE changes all instances of one or more characters in a set of characters with a character string.

To change the first three characters of a string, do this:

substring(varname, 1, 3) = "123".

If this is a space-delimited string, there's also

ENTRY(1, varname, " ") = "123".

Neither are very intuitive, but they work.

Tim Kuehn

Posted by Admin on 09-Oct-2006 01:40

Hi

First, thank you for your fast reply.

Your solution, Salvador Vinals, is good, but one problem is there:

If the telephone number contains that the preselection twice, these are also changed.

Example: 01 675 55 01 to 044 675 55 01,

But it becomes so: 044 675 55 044.

Thanks for your answers

Greets Hannes

Posted by Admin on 13-Oct-2006 06:16

Can anybody help me??? Pleasseee

Greets

Posted by Thomas Mercer-Hursh on 13-Oct-2006 10:53

Looks to me like Tim has given you a solution. What is wrong with that?

This thread is closed