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.


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:

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


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


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