>Thanks for sharing this.
>
>It ALMOST works... I've found 2 problems with my testing:
>
>1. String length of Character data can only be 254 max, so I added this code:
>
>CASE m.lcType == "C"
> lnLen = Min(LEN(m.lvValue), 254)
> lcFields = m.lcFields + "(" + LTRIM(STR(lnLen)) + ")"
>
>I suppose the real solution would be to use a Memo type in this case so that no data would be lost off the end of the string.
>
>
>2. it does not handle decimals properly, if the decimal values equate to 0.
>
>For instance, a value of 1.00 is resulting in a field of N(1), whereas it should be N(4,2). This is causing an error: "Field width or number of decimal place is invalid)"
>
You are welcome
:)
This is a very simple and basic function, so you must extend it for production use.
Regards,
Ony