I need to fix a Foxpro 2.5 program. The PICTURE clause on an @GET statement is not doing what I thought it should.
I want to display a telephone number as (123)444-5555 format. If the input variable, innum='1234445555' and I use
@1,45 GET innum PICTURE '(999)999-9999' the result is
(234)455-5335
Each character in the PICTURE is replacing the corresponding position of the input string. For example, '(' replaces the '1'. Then when the PICTURE runs out of digits to replace it starts picking up some in between.
I always thought that the extra characters just got inserted into the result and did not replace a position.
I want to display a telephone number as (123)444-5555 format. If the input variable, innum='1234445555' and I use
@1,45 GET innum PICTURE '(999)999-9999' the result is
(234)455-5335
Each character in the PICTURE is replacing the corresponding position of the input string. For example, '(' replaces the '1'. Then when the PICTURE runs out of digits to replace it starts picking up some in between.
I always thought that the extra characters just got inserted into the result and did not replace a position.