Histórico da Página
Composition Setup |
---|
import.css=/download/attachments/6062824/tecnologia.css |
Portuguese |
Pagetitle | ||||
---|---|---|---|---|
|
Inverte os bits dos caracteres de uma string.
Sintaxe
Bloco de código | language | cpp|
---|---|---|
| ||
NotBit( < @cStr >, < nLength > )
|
Parâmetros
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 |
|
Observações
- nLength inicia em 1.
- Caso o tamanho da string passada em cStr seja menor do que o valor passado em nLength, a aplicação AdvPL é interrompida com a exceção "Bit string out of bounds on NotBit".
Exemplos
Bloco de código | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
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
|
Veja também
...
Visão Geral
Import HTML Content
Conteúdo das Ferramentas
Tarefas