kdb while loop - Kdb+ / qStudio

Home Forums Kdb+ / qStudio kdb while loop

This topic contains 2 replies, has 1 voice, and was last updated by  nike air discount 7 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #23784

    Matt Bell

    Hi,

    Is it possible to write a while loop in kdb?

    Or what about other loops, does kdb support for loops, do while loops?

    How can I control running a process a certain number of times?

    #58291

    Chris Webb

    Yes it is possible to do that. You can look it up at http://code.kx.com/wiki/Reference/while

    I can give you an example:

    cumsum:{[n]
    a:0;
    while [not n = 0;
    a:a+n;
    n:n-1;
    ];
    :a
    }

    I believe it is self explanatry what happens.

    I hope this answers your question.

    Regards,

    Chris

    #96724

    nike air discount

    8. ARISTOTE. Sur are generally figurine d’Hermias, 脿
    nike air discount http://www.tace.or.th/airmax90-fr.asp?p=4660

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.