Windows.OPEN(Text000+ Text001+ Text002); IF g_intTableNo >0 THEN g_recField.SETRANGE(TableNo,g_intTableNo); IF g_recField.FIND('-') THEN IF g_recField.Enabled = TRUE THEN REPEAT CLEAR(g_rrfRecordRef); CLEAR(g_krfKeyRecordRef); g_rrfRecordRef.OPEN(g_recField.TableNo); g_krfKeyRecordRef.OPEN(g_recField.TableNo); Windows.UPDATE(1,g_recField.TableName); // g_krfKeyRef := g_rrfRecordRef.KEYINDEX(1); g_intKeyCount := g_krfKeyRef.FIELDCOUNT; FOR i:= 1 TO g_intKeyCount DO BEGIN g_frfFieldIndex[i] := g_krfKeyRef.FIELDINDEX(i); END; IF g_rrfRecordRef.FIND('-') THEN BEGIN g_frfFieldRef := g_rrfRecordRef.FIELD(g_recField."No."); Windows.UPDATE(2,g_recField.FieldName); // IF (g_recField.Type = g_recField.Type::Code) OR (g_recField.Type = g_recField.Type::Text) THEN REPEAT CLEAR(l_txtNewValue); CLEAR(l_txtOldValue); CLEAR(l_txtKeyValue); CLEAR(l_booKeyColumn); l_txtOldValue := g_frfFieldRef.VALUE; Windows.UPDATE(3,l_txtOldValue); // FOR i:= 1 TO STRLEN(l_txtOldValue) DO BEGIN cSTR := l_txtOldValue[i]; IF (cSTR <> 13) AND (cSTR <> 10) THEN l_txtNewValue += FORMAT(l_txtOldValue[i]); END; g_txtNewValue := l_txtNewValue; FOR i:= 1 TO g_intKeyCount DO BEGIN IF g_frfFieldRef.NAME = g_frfFieldIndex[i].NAME THEN BEGIN l_intKeyIndex := i; l_booKeyColumn := TRUE; g_frfFieldIndex[i].VALUE := l_txtNewValue END; IF l_booKeyColumn THEN BEGIN //f_booRenameKeyField(g_intKeyCount); f_inserKeyField(g_intKeyCount); END ELSE BEGIN g_frfFieldRef.VALUE := l_txtNewValue; //IF NOT g_rrfRecordRef.MODIFY THEN // ERROR('Modify failure Column: %1 Value: %2',g_frfFieldRef.NAME,l_txtNewValue); END; END; UNTIL g_rrfRecordRef.NEXT = 0; g_rrfRecordRef.CLOSE; END; UNTIL g_recField.NEXT = 0; MESSAGE('Finished!'); Windows.CLOSE; --------------------------------------------------- [Function:f_booRenameKeyField(p_intKeyCount : Integer)] CASE p_intKeyCount OF 1: BEGIN g_rrfRecordRef.DELETE; g_frfFieldRef.VALUE := g_frfFieldIndex[1].VALUE; g_rrfRecordRef.INSERT; END; END;
Comments
http://www.mibuso.com/dlinfo.asp?FileID=1149
It's "Remove TAB CR and LF from Text Fields" option will do what you want.
If the item without the CRLF already exists in the database it'll fail to rename the item, but that's okay because all the postings attached to the item will be renamed. So you can delete it.
TVision Technology Ltd
OOHHH~~thank you so very much.
its really help me a lot.
i'm will go research the code.
really a big help
Thank you.