Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

Bloco de código
languagecpp
themeEclipse
titleExemplo 1
linenumberstrue
collapsefalse
#include "TOTVS.ch"
user function Exemplo()
  Local cUncomp := "", cComp := ""
  Local nLenComp := 0, nHandle := -1
  Local cText := ""
  Local cTxtFile := "", cGzFile := ""
  Local cEnvPath := ""

  cText := "Teste da funcao GzStrComp."
  
  cTxtFile := "\file.txt"
  cGzFile := "\file.gz"

  nHandle := FCreate( cTxtFile )
  FWrite( nHandle, cText )
  FClose( nHandle )

  GzStrComp( cText, @cComp, @nLenComp )

  nHandle := FCreate( cGzFile )
  FWrite( nHandle, cComp )
  FClose( nHandle )

  if isSrvUnix() 
    cEnvPath := GetSrvProfString( "RootPath", "" )
    GzDecomp( cGzFile, cEnvPath )
  else
    GzDecomp( cGzFile, "\" )
  endif 

  GzStrDecom( cComp, nLenComp, @cUncomp )
  
  FErase( cTxtFile )
  FErase( cGzFile )
  
  ConOut(cUncomp) // Resultado: "Teste da funcao GzStrComp."
  
return

Abrangência

Application Server 13.0.0.0

Veja também