Gentlemen,
I am quite confused about the goto statement. I have never used one as it is considered by many to be "unsophisticated". But I have been playing with them in an attempt to write a CF that consumes a lot of CPU time without the use of for/next, while/endwhile, delay or SetLCD statements as all of these resets the WDT mechanism.
So I set out to write a non-sense program that used nested for/next loops and a lot of string functions. I picked on the string functions because they are slow.
I wrote the following nonsense code and cannot get it to compile:
' for_next
'
' This code is an eumulation of a for/next loop using goto statements
'
'
/*
for j = 1 to 3
b = b + b
next
*/
j = 1 ' loop counter initialization
@200
if j > 3 ' range check
goto @220
else
' loop body
'
b = b + b
@210 ' continue entry point
j = j + 1 ' counter + step value
goto @200
endif
@220 ' loop exit
[/color]
The compiler exits with the following error message:
Error:Undefined GOTO destination: @: "-36"
and the first 3 characters of the last line of the program are highlighted in yellow:
@220 ' loop exit
Any idea what this error message means?
Any idea what I have done to offend the compiler?
Best regards,
Gary D*ckinson