equality madness


  1. tiagojanz

    tiagojanz New Member

    Hi, I am trying to iterate trough a list, since I cant post images I'll try my best to post the code



    Code:
    
    def found = false
    def explo make a list
      
                               Espinho
                               Lisboa
                               Santa Maria dos Olivais
    
    web.gottext
    {
         found = true
         find(responseContent1)
         ifelse(found)
             then do{
                  some action
             }
            else do{
                  some other action
            }
    }
    
    find(search)
    {
    
         foreach local  in list explo
        {
            if test  text= (arg[0]:local, arg[1]:search)
            {
                  set found = true
            }
    
        }
    }
    
    
    
    
    


    When search argument is Santa Maria dos Olivais it should find it in the explo list right?

    Advertisement
  2. appinventor

    appinventor Active Member

    tiagojanz, all you can use one of 2 built-in blocks:

    [is-in-list?] returns true or false
    [position in list] returns the index of the item or 0 if it is not found

Share This Page