import.css=/download/attachments/6062824/tecnologia.css |
Inverte os bits dos caracteres de uma string.
NotBit( < @cStr >, < nLength > ) |
Nome | Tipo | Descrição | Obrigatório | Referência |
---|---|---|---|---|
cStr | caractere | Indica a string que será modificada. | X | X |
nLength | numérico | Indica a quantidade de caracteres que terão seus bits invertidos. | X |
|
User Function tstNotBit() Local cStr := "", cRet := "" Local nLen := 0 cStr := chr( 255 ) + chr( 255 ) + chr( 255 ) + chr( 255 ) nLen := Len( cStr ) NotBit( @cStr, nLen ) //será exibida a string "00000000000000000000000000000000" conout( bitstrdump( cStr ) ) return STATIC Function BitStrDump( cString, nStart, nLength ) Local cStrDump := '', cAsc := '' Local nTamStr := len( cString ), nI := 0 DEFAULT nStart := 1 DEFAULT nLength := nTamStr cString := SubStr( cString, nStart, nLength ) For nI := 1 to nTamStr cASC := SubStr( cString, nI, 1 ) cStrDump += NToC( Asc( cASC ), 2, 8, "0" ) Next nI Return cStrDump |