Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

alltrim with edit box

Status
Not open for further replies.

fishman13

Programmer
Jul 8, 2002
73
0
0
US
I am trying to scan a table and pull a field called note_line(which is 250 characters). I am then scanning through the cursor and adding all the note lines together and populating a edit box with it. The problem I am having is with trying to remove spaces at the end.

After I join all the notes together the strings length is a multiple of 250. I tried using alltrim to try and remove the trailing spaces, but it does not appear to remove them since the message box always shows the same amount. If I use the delete key I can remove the spaces. Is there something that anybody acn see that I have done wrong

Thanks


scan
thisform.tst_info.value = thisform.tst_info.value + cur_note.note_line
endscan
messagebox(str(len(thisform.tst_info.value)))
alltrim(thisform.tst_info.value)
messagebox(str(len(thisform.tst_info.value)))
 
HI

scan
thisform.tst_info.value = thisform.tst_info.value ;
- cur_note.note_line
endscan

Instead of using +, use -
OR use ALLTRIM(cur_note.note_line)

:)

____________________________________________
ramani - (Subramanian.G) :)
When you ask VFP questions, please add VFP version.
 
Try this:
Code:
scan         
 thisform.tst_info.value = trim(thisform.tst_info.value ) ;
                         + " "+ cur_note.note_line
endscan
 
Just to clarify, ALLTRIM() removes leading and trailing spaces, not any apces contained within a string. So:

ALLTRIM(' abc def ghi....zzz ')
-would become-
'abc def ghi....zzz'
-not-
'abcdefghi....zzz'


-Dave S.-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top