# question

## SB saying that it didnt expect a variable I had set earlier in code ????

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:

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

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The error is in the line:`

`````` If number>high Then high=number
``````

The statement high=number should be on its own line (no characters after the Then !)

· 1

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Ah Ha!
I knew it had to be something simple.

Thank you :-)