Hi,

I hope someone can point me in the right direction. I want to record the highest number in the variable "high"

I'm getting this error:

"I found 'high' when I was not expecting it", for line 76 which reads : If number>high Then high=number

Variables high and number set earlier in programme

Any ideas?

Section of code where error seems to be:

number1=textwindow.ReadNumber()

evens=0

odds=0

count=0

high=0

number=number1

While number<>"1"

'count steps

count=count+1

'Establish whether number entered is odd or even

rem= Math.Remainder (number,2)

If (rem = 0) Then

TextWindow.ForegroundColor="Yellow"

TextWindow.Write( number + " is even, so divide by 2 ")

evens=evens+1

number = number/2

TextWindow.CursorLeft=40

TextWindow.WriteLine("result = " + number)

TextWindow.ForegroundColor="White"

Else

TextWindow.ForegroundColor="White"

TextWindow.Write( number + " is odd, so x 3 and + 1 ")

odds=odds+1

number = number*3

number = number+1

If number>high Then high=number

EndIf

TextWindow.CursorLeft=40

TextWindow.WriteLine("result = " + number)

Program.Delay(300)

EndIf

EndWhile