1. 2015 is going to be a great year for Android! Why wait??
    Samsung Galaxy Note 5 | Samsung Galaxy S6 | HTC One M9
  2. New Forum Created: Samsung Gear VR!

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 (Text):


    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
Loading...
Similar Threads
  1. Ragin Cajun
    Replies:
    3
    Views:
    1,155
  2. ji33nx
    Replies:
    2
    Views:
    187
  3. VegasOnAcid
    Replies:
    3
    Views:
    590
  4. LECTER
    Replies:
    16
    Views:
    1,042
  5. mattcoz
    Replies:
    6
    Views:
    608

Share This Page