Lista de inteiros

Discussão em 'Progress 4GL' iniciado por jaozi_nho, Fevereiro 26, 2013.

  1. jaozi_nho

    jaozi_nho Membro Participativo

    Olá, alguem sabe como faz para criar uma lista de inteiros e usa-las no for each, por exemplo transformar o primeiro for each no segundo.

    for each tt-tabela no-lock where
    tt-tabela.situacao = 1 and
    tt-tabela.situacao = 2 and
    tt-tabela.situacao = 5 and
    tt-tabela.situacao = 6 :

    ...
    end.


    def var list as list no-undo.

    assign list = (1,2,5,6)

    for each tt-tabela no-lock where tt-tabela.situacao exists in list:
    .....
    end.



    Agradeço.
  2. LeandroSantos

    LeandroSantos Membro Participativo

    Tete isto:
    Código:
    lista = "1,3,5,7,9".
    for each tt-tabela no-lock
       where lookup(string(tt-tabela.situacao),lista) > 0.
       
       disp tt-tabela.
       
    end.
    
  3. jaozi_nho

    jaozi_nho Membro Participativo

    lookup funcionou, obrigado.

Compartilhe esta Página