>Hello comunity
>
>I need a function or coding to check the following.
>I need to create on my table article, on my field REF C(18), new codes for my production product.
>this products are composed like this
>
>01.nnnnnn-Q1
>02.nnnnnn-Q2
>Where 01 or 02 are the type of products
>nnnnnn are numeric with lenght of six digits
>and Q1 or Q2... is the version of my final product.
>
>Then i need to build coding that make this approach.
>1- find if "." (point) and "-" both exist on my field REF
>2- if it is the first new article then "nnnnnn" the value must me increase by 1 , like 000001 and so on.
>
>can someone could give a simple coding exemple to do that, because i dont know if i can use for exemple the VFP function:
>text1 $ text2
>Because i need to check if both "." (point) and "-" exist..
>
>Many thanks,
>Best regards
>Luis Santos
It might be better (and easier) to use a table with the next sequence of 01, 02, etc rather than fiddling with extracting numeric portions and incrementing
And if you must fiddle - use regular expressions
Gregory