Code: Select all | Expand
// oSegment is a get
oSegment:bGotFocus := { |oClp| ColToString( oClp ) }
STATIC PROCEDURE ColToString( oClp )
LOCAL cText
IF oClp:Open() <<== Crashes with TGet():MsgNotFound(0) here
cText := AllTrim( oClp:GetText() )
IF cText != NIL
IF _LF $ cText
cText := StrTran( cText, _CRLF, _LF )
cText := StrTran( cText, _LF, "," )
cText := StrTran( cText, " ", "," )
cText := AllTrim( cText )
DO WHILE Right( cText, 01 ) == ","
cText := RTrim( Left( cText, Len( cText ) - 1 ) )
ENDDO
oClp:Clear()
oClp:SetText( cText )
ENDIF
ENDIF
oClp:Close()
ENDIF
RETURN