richen
3rd September 2004, 16:48
I have a text field what i want to strip because it is too long

i have done the following


string description(30)

select tttxt010.*
from tttxt010
where tttxt010.ctxt = :tiitm001.txts
and tttxt010.clan = "4"
and tttxt010.seqe = 1
selectdo
endselect

description = strip$(shiftl$(tttxt010.text))

but when i print de session description shows 240 characters instead of 30 characters

Is there an other way to do this?

mark_h
3rd September 2004, 18:00
Not sure why that does not work. But this certainly should:


description = shiftl$(tttxt010.text)
description = description(1;30)


Of course it might even be that you just need to declare description as fixed, seems I had a problem not too long ago where I had to make a string fixed. Can't remember.

Mark

kbartelds
3rd September 2004, 18:27
Why not use text.to.buf function, this will certainly take care of the problem, which might be related to the \n in the text.

Regards,
Klaas

Hitesh Shah
4th September 2004, 08:54
Just to add another possibility, is there different input variable /declared variables 'description' in the report. The variable is not declared extern also in ur code.

richen
7th September 2004, 11:17
I have used text.to.buf and the problem is solved :)

THANX