Histórico da Página
Composition Setup |
---|
import.css=/download/attachments/6062824/tecnologia.css
|
...
Pagetitle | ||||
---|---|---|---|---|
|
Descompacta uma string no formato gzip.
Sintaxe
Bloco de código | ||
---|---|---|
| ||
GzStrDecomp( < cSource >, < nSourceLen >, < @cTarget > )
|
Parâmetros
Nome | Tipo | Descrição | Obrigatório | Referência |
---|---|---|---|---|
cSource | caractere | Indica a string que está compactada. | X |
...
nSourceLen | numérico | Indica o tamanho da string compactada. | X |
...
cTarget | caractere | Indica a string descompactada. | X | X |
Retorno
Nome | Tipo | Descrição |
---|---|---|
lRet | lógico | Retorna .T. se a descompactação for realizada com sucesso; |
...
caso contrário, retorna .F.. |
Informações | |||||
---|---|---|---|---|---|
|
| ||||
|
Exemplos
Bloco de código | theme | Eclipse|||||||||
---|---|---|---|---|---|---|---|---|---|---|
| title
| Exemplo 1
| ||||||||
user function exemplo#include "TOTVS.ch" User Function Exemplo() Local lRet := .F. LocalcComp cDataText := "" Local cCompText := "", cUncomp Local cDecText := "" Local nDataLen := 0 LocalnLenComp nCompLen := 0, nLenUncomp Local nDecLen := 0 cDataText := "Testing function GzStrDecomp..."cComp nDataLen :=MemoRead( "\mygzip.gz Len( cDataText ) ConOut( "cDataText [" + cDataText + "]" ) ConOut( "nDataLen [" + AllTrim( Str( nDataLen ) ) + "]" )nLenComp lRet :=Len( cComp GzStrComp( cDataText, @cCompText, @nCompLen ) If ( lRet == .F. )cUncomp := ConOut( "GzStrComp call NOK" ) Else ConOut( "GzStrCompnLenUncomp := 0 call OK" ) EndIf lRet := GzStrDecomp(cComp cCompText,nLenComp, @cUncomp ) nLenUncomp := Len( cUncomp ) nHandle := FCreate( "\myfile.txt" ) FWrite( nHandle, cUncomp, nLenUncomp ) FClose( nHandle ) return Veja tambémGzStrCompnCompLen, @cDecText )
If ( lRet == .F. )
ConOut( "GzStrDecomp call NOK" )
Else
ConOut( "GzStrDecomp call OK" )
EndIf
nDecLen := Len( cDecText )
ConOut( "cDecText [" + cDecText + "]" )
ConOut( "nDecLen [" + AllTrim( Str( nDecLen ) ) + "]" )
If ( cDecText <> cDataText )
ConOut( "cDecText <> cDataText" )
lRet := .F.
Else
ConOut( "cDecText == cDataText" )
EndIf
If ( nDecLen <> nDataLen )
ConOut( "nDecLen <> nDataLen" )
lRet := .F.
Else
ConOut( "nDecLen == nDataLen" )
EndIf
If ( lRet == .F. )
ConOut( "GzStrDecomp NOK" )
Else
ConOut( "GzStrDecomp OK" )
EndIf
Return
|
Abrangência
Application Server 13.0.0.0
Veja também
Visão Geral
Import HTML Content
Conteúdo das Ferramentas
Tarefas