while(%val < 10)
{
    // Do something
    %val++;
}