# Error in Published Program

• ### Question

• I have 'Published' the following program.

'  Program accepts input of times
'  & makes an average of the
'  difference between them.
'  It takes the start time
'  & compares it with the next time imput
'  thereby calculating a time span.
'  The next time imput is compared with the one before it
'  & a new time span calculated. Etc.
'  The Average is an average of the Time Spans.

TextWindow.Title = "Average Frequency"

'  Place text window in center of screen
TextWindow.Top = 300
TextWindow.Left = 300

'  Main Program
TextWindow.WriteLine("Enter 0 to finish")
TextWindow.WriteLine("")
increment = -1
x = 0
y = 0
While "True"
TextWindow.WriteLine("Enter time")
If x = 0 Then
Goto CalculateAverage
EndIf
DecimalHours()
If x <> 0 And y <> 0 Then
If y > x Then
x = x + 24
EndIf
gap = x - y
total = total + gap
EndIf
y = x
increment = increment + 1
EndWhile

CalculateAverage:
z = total/increment
UnDecimalHours()
average = z
TextWindow.WriteLine("")
TextWindow.WriteLine("Average = " + average)
TextWindow.WriteLine("")

'  Hours & minutes in decimal hours
Sub DecimalHours
' Takes a number - x - and converts
' it from hours and minutes
' into decimal hours and outputs
' the result as  x
hours = Math.Floor(x)
' Extract minutes
mins = ((x - hours)*100)/60
' Turn minutes into decimal hours
mins = (Math.Round(mins*100))/100
' Reconstitute  x  as  decimal hours
x = hours + mins
EndSub

'  Decimal hours as hours & minutes
Sub UnDecimalHours
' Takes a number - z - and converts
' it from decimal hours into
' hours and minutes and outputs
' the result as  z
hours = Math.Floor(z)
mins = (z - hours) * 60
mins = mins/100
z = hours + mins
z = 0.01*Math.Floor(100*z+0.5)
EndSub

The program ID is HGP110. When I try to access it on-line, I get the error message:

0,0: Unrecognized statement encountered.

Can anyone tell me what it is in my program that is causing the error and how I might adjust the program to prevent the error from occurring?

It's the first time I've 'Published' anything.

Thanks,

Buckfast

Friday, April 5, 2013 7:51 AM

• I think program ID HGP110 is wrong or there was some trouble when publishing.

Anyway HGP110 is not published now.  So please try "Publish" again.

Nonki Takahashi

• Proposed as answer by Friday, April 5, 2013 5:19 PM
• Marked as answer by Saturday, April 13, 2013 2:17 PM
Friday, April 5, 2013 9:19 AM

### All replies

• I think program ID HGP110 is wrong or there was some trouble when publishing.

Anyway HGP110 is not published now.  So please try "Publish" again.

Nonki Takahashi

• Proposed as answer by Friday, April 5, 2013 5:19 PM
• Marked as answer by Saturday, April 13, 2013 2:17 PM
Friday, April 5, 2013 9:19 AM
• Thank you, Nonki,

I refined the program while awaiting an answer. I have published it and the program ID is WSZ569. Publishing was successful.

Buckfast

Friday, April 5, 2013 2:53 PM