1

Loop not clear

Hi there,

Although loops are explained in your manual, it is not yet clear how you would, for example, in a table called "contacts" with only "firstname" and "lastname" but where some firstnames are missing (empty), fill in the missing information with "Norbert" ?  

Thanks for your help

3replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
    • Fred
    • Fred
    • 3 mths ago
    • Reported - view

    Yeah the manual is not very good. 

    You can try something like:

    let loop1 in select contacts[firstnames = null] do
    loop1.firstnames := "Norbert"
    end
    

    or if you have your select in a variable already you can do:

    let x := select contacts
    let loop1 in x[firstnames = null] do
    loop1.firstnames := "Norbert"
    end
    
    Like
    • Chris
    • Chris
    • 3 mths ago
    • Reported - view

    Thank you Fred for your answer but I cannot make it work ...

    It seems that "let loop1 in" ... where "in" is not digestible ... is the issue.

    There is no hurry but I would love to make it work !

    Like
    • Fred
    • Fred
    • 3 mths ago
    • Reported - view

    oops, it should be:

    for loop1 in select contacts[firstnames = null] do
    loop1.firstnames := "Norbert"
    end
    

    typing too quick for my brain to follow.

    it is a for loop so I need to put a for in the beginning. :)

    Like
Like1 Follow
  • Status Answered
  • 1 Likes
  • 3 mths agoLast active
  • 3Replies
  • 49Views
  • 2 Following