Answered by:
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")
x= TextWindow.ReadNumber()
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)
EndSubThe program ID is HGP110. When I try to access it online, 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
Answers

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 litdevModerator Friday, April 5, 2013 5:19 PM
 Marked as answer by Nonki TakahashiModerator Saturday, April 13, 2013 2:17 PM
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 litdevModerator Friday, April 5, 2013 5:19 PM
 Marked as answer by Nonki TakahashiModerator Saturday, April 13, 2013 2:17 PM
