first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

Limitations of the Do Loop

Using multiple conditions in the Do Loop structure with the Like operator do not always evaluate properly. In such cases, the use of Exit Do helps. For example, the following Do Loop condition is never true:

Do Until g_str Like "*PAGE*" Or g_str Like "*[#]*[#]*[#]*"
    g_str = .ReadLine 'This method is inside a With block.

    'Other stuff goes here.

Loop

However, the following works as planned: Do g_str = .ReadLine 'This method is inside a With block.

    If g_str Like "*PAGE*" _ 
        Or g_str Like "*[#]*[#]*[#]*" Then Exit Do

    'Other stuff goes here.

Loop
mod date: 1998-10-29T20:54:50.000Z