Árvore de páginas

Destrói a Lista

Sintaxe

 

nRet := oTQLS:Destroy( )

Parâmetros

NomeTipoDescriçãoObrigatórioReferênciaObservações

Retorno

NomeTipoDescriçãoObservações
nRet 
Numérico

se executou corretamente retorna 0 ("OK"), caso contrário contem o número do erro

 

Observações

Exemplos

Exemplo 

Destroy
#include 'protheus.ch'

// Setup Redis
Static cRedisHost := "tec-clima"
Static nRedisPort := 6379


User Function LstRem()
  Local nRet       := 0
  // Nome da Lista
  Local cListName := "Lista_TQLS"
  // Objeto de Lista
  Local oTQLS := Nil
  // Cria um novo objeto de Lista
  oTQLS := TListSvc():New(cListName)
  If(oTQLS == Nil)
    ConOut("### ERRO ### " + "Erro na criacao da Lista - " + cListName)
    Return .F.
  Else
    ConOut("Criacao da Lista  OK - " + oTQLS:cName)
  EndIf
  // Configurando a Lista
  nRet := oTQLS:Setup(cRedisHost, nRedisPort)
  If nRet != 0
    ConOut("### ERRO ### " + "Erro ao fazer o Setup" + " Erro: " + AllTrim(Str(nRet)))
    Return .F.
  Else
    ConOut("Setup de Lista   OK - " + oTQLS:cName + " nMsgRetPer: " + AllTrim(Str(oTQLS:nMsgRetPer)))
  EndIf
  // Destruindo a Lista
  nRet := oTQLS:Destroy( )
  If nRet != 0
    ConOut("### ERRO ### " + "Erro ao destruir a Lista " + " Erro: " + AllTrim(Str(nRet)))
    Return .F.
  Else
    ConOut("Destruiu a Lista  OK - " + oTQLS:cName)
    Return .T.
  EndIf
Return .T.
 

Veja também

  • Sem rótulos