ADD oCol TO oLbx AT 5 DATA {|x| x := _ChkComp(oRsRepair:Fields("cc"):Value) };
HEADER "Instructions" size 165
...
...
//-------------------
Static Func _ChkComp( cComplaint )
Local cName
cName := cComplaint
Return(cName)
#include "FiveWin.ch"
#include "xbrowse.ch"
function Main()
local oDlg, oBrw
DEFINE DIALOG oDlg SIZE 300, 200
@ 0, 0 XBROWSE oBrw OF oDlg ;
ARRAY { "Tom Jones", "Tom"+chr(32)+"Jones", "Tom"+chr(14)+"Jones" } ;
AUTOCOLS
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTER
return nil
function Conversion(uData)
local cReturn := ""
local i := 0
for i = 1 to len(uData)
if asc(substr(uData,i,1)) < 32
cReturn := cReturn + "?"
else
cReturn := cReturn + substr(uData,i,1)
endif
next
return cReturn
avista wrote:Hi Rao,
Thanks verry much for reply.
One more Question please,
How to detect non-printable characters ? (control chars like you said) .
Less than 32 or ? (probably no ...CRLF chr(13)+chr(10) is not binary ... ?)
Which ASCII codes to control ? Is it good to replace them with "?" or ?
Or need i analize blocks ?
Thanks again for helping,
Best regards.
FUNCTION MyBinaryConversion( cData )
local cVrati := ""
local cChar := ""
local nAsc := 0
local i := 0
IF !IsBinaryData( cData )
return cData
ENDIF
FOR i = 1 TO LEN( cData )
cChar := SUBSTR( cData, i, 1 )
nAsc := ASC( cChar )
IF nAsc < 32 .AND. ;
nAsc <> 9 .AND. nAsc<> 10 .AND. nAsc<> 13 .AND. nAsc<> 26
cVrati := cVrati + CHR( 127 )
ELSE
cVrati := cVrati + cChar
ENDIF
NEXT
RETURN cVrati
FOR i := 1 TO Fcount()
IF !Empty( oCol := oBrw:oCol( oBrw:oCol(i):cHeader ) )
IF FieldType( i ) == "M" .OR. ;
FieldType( i ) == "C"
oCol:bStrData := { || MyBinaryConversion( EVAL(oCol:bEditValue) ) }
ENDIF
ENDIF
NEXT
FOR i := 1 TO Fcount()
IF !Empty( oCol := oBrw:oCol( oBrw:oCol(i):cHeader ) )
IF FieldType( i ) == "M" .OR. ;
FieldType( i ) == "C"
cField := oBrw:oCol(i):cHeader
oBrw:oCol(cField):bStrData := { || MyBinaryConversion(EVAL(oBrw:oCol(cField):bEditValue)) }
ENDIF
ENDIF
NEXT
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot], Silvio.Falconi and 103 guests