Hi Darrell,
The problem is that as soon as total = gnLower the num1 value is not changing. No matter what is rand():
INT(rand()+ whole_number)= whole_number
>I'm having some issues with the code below where that causes my app to freeze up. This code is in a scan..endscan where I create the 2 numbers below and then update values in a table. The code does not freeze up consistently but I can duplicate it if I run it enough but there is no particular pattern to the problem. any ideas?
>
>
>
> gnLower = 10
> gnUpper = 99
>
> total = INT((gnUpper - gnLower + 1) * RAND() + gnLower)
> num1=total
> do while num1=total
> num1 = INT((total - gnLower + 1) * RAND() + gnLower)
> num2 = total - num1
> if num1=num2
> num1=total
> endif
> enddo
>