PRB: Text in Edit Region Is Double Spaced After a READLast reviewed: May 16, 1997Article ID: Q112185 |
The information in this article applies to:
SYMPTOMSText in an edit region appears double-spaced after changes are made to the text during a READ.
CAUSEWhen changes are made to the text in the edit region, FoxPro for Macintosh adds a CHR(13)--a carriage return--immediately following any CHR(10)--a linefeed--within the text.
RESOLUTIONUse the edit region's VALID clause to remove the CHR(13) characters from the text. For example, the following statement uses the STRTRAN() function to remove all CHR(13) characters from the text memory variable called m.notes:
m.notes=STRTRAN(m.notes,CHR(13)) MORE INFORMATION
Steps to Reproduce BehaviorTo illustrate the problem of FoxPro adding CHR(13) characters in text, run the following program, which counts the number of CHR(13) characters in the edit region's VALID clause.
CLEAR m.notes="Line1"+CHR(10)+"Line2"+CHR(10)+"Line3"+CHR(10)+"Line4" WAIT WINDOW "There are "+cntchr13(m.notes)+ ; " CHR(13) characters in m.notes" @2,2 edit m.notes size 10,25 scroll READ WAIT WINDOW "There are "+cntchr13(m.notes)+ ; " CHR(13) characters in m.notes" FUNCTION cntchr13 PARAMETER teststring chrcount=0 DO WHILE AT(CHR(13),teststring)<>0 chrcount=chrcount+1 teststring=STRTRAN(teststring,CHR(13),"",1,1) ENDDO RETURN ALLTRIM(STR(chrcount))When the above program is executed, if a change is made in the edit region, the wait window following the READ command will return a number greater than zero. If no changes are made (for example, the TAB key is pressed), no CHR(13) characters will be shown in the wait windows.
|
Additional query words: CR LF line feed modify alter modified
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |