Skip to Content
0
Former Member
Dec 11, 2007 at 04:08 PM

While Wend Loop

53 Views

Post Author: John

CA Forum: Formula

I have this code in CR 9....

WhilePrintingRecords;stringVar flaga := 'false';stringVar flagb := 'false';numberVar a := 0;

While {Combine_CR_Table.Field1} = {Combine_CR_Table.Field1} do If {Combine_CR_Table.Field7} = "TLC METHOD" and flaga <> 'true' then a := a + 1 * (remaining text does not appear to be part of formula)

flaga := 'true' *(remaining text does not appear to be part of formula)

If {Combine_CR_Table.Field7} = "GC/MS METHOD" and flagb <> 'true' then a := a + 1 flagb := 'true'

Wend *(No matter what I add to the code above, ";" or "and".. this keeps reading that it is not part of the formula.)

a := a + 1

flaga := 'false'flagb := 'false'

So.. the errors I am getting are the same. Note *s above. I have used Else If, End If, and tried ";" and "and" at the end of each line.

If I take from the "Wend" down, out, and put a ; after the addition (a := a + 1) and the first flaga = "true" then I get no errors when I perform a check. However, when I run it, it gives me an error "The loop was evaluated more than the maximum number of times".

Anybody see the holes in this code and why it won't let me put If statements in and While/Wend command?

Thanks

John