>Thanks Dragan,
>
>I'll hold on to this one. However since it doesn't remove leading spaces I guess we'll have to keep what we have. We've had some enter almost a whole line of leading spaces which messes with our report writing program.
>
>>n=alines(laRows, this.value)lcOutValue=""
>lOK2Copy=.f. && this will be .t. when we've found first non-empty line
>for i=1 to n if lOK2Copy
> lcOutValue=lcOutValue+chr(13)+laRows[i] && just copy it as a new line
> else
> lOK2Copy=!empt(LTrim(laRows[i])) && .t. when we find the first not empty line
> if lOk2Copy
> lcOutValue=LTrim(laRows[i]) && start with this line, left trimmed
> endif endifendforthis.value=lcOutValue
Well, you could LTrim() all lines - I've written this to do it with leading lines only, because that's wha I understood you need. You may modify it as you like until you get what you need.