Currently, if you forget to include the counter following Next in a For statement there are nine error messages displayed: 303, 301 (x2), 304 (x6). This mistake is easy to do particularly if you are switching between other third-party versions of Basic (e.g. MS Visual Basic Express) or Fortran, and MikroBasic Pro. Might I suggest a specific test/error message for this?
Regards,
Allen
Error messages - Missing counter after Next in For statement
-
- Posts: 32
- Joined: 23 Dec 2009 22:48
- Location: Melbourne, Australia
Error messages - Missing counter after Next in For statement
Regards,
Allen
Allen
- ranko.rankovic
- Posts: 433
- Joined: 11 Jun 2010 09:22
Re: Error messages - Missing counter after Next in For state
Hello allenandholmes,
Please can you demonstrate this with some little example, so we can look deeper into it.
Thank you in advance for help.
Best regards
Please can you demonstrate this with some little example, so we can look deeper into it.
Thank you in advance for help.
Best regards
Ranko Rankovic
mikroElektronika [Support Department]
mikroElektronika [Support Department]
-
- Posts: 32
- Joined: 23 Dec 2009 22:48
- Location: Melbourne, Australia
Re: Error messages - Missing counter after Next in For state
Herewith further information as required:
Gives following error messages:
(I have removed other unnecessary messages)
259 1010 Hint: Unit "errors.mbas" has been recompiled errors.mbas
1 1015 Hint: Compiling unit "J:\mikroBasic Pro Projects\lcd.mbas" lcd.mbas
49 303 Identifier "end" was not declared lcd.mbas
49 301 "sub"is not valid identifier lcd.mbas
51 301 "procedure"is not valid identifier lcd.mbas
51 304 Syntax error: Expected "end" but "LCD_Scroll_Array_Reset" found lcd.mbas
51 304 Syntax error: Expected "sub" but "(" found lcd.mbas
51 304 Syntax error: Expected "end" but ")" found lcd.mbas
53 304 Syntax error: Expected "sub" but "dim" found lcd.mbas
53 304 Syntax error: Expected "end" but "i" found lcd.mbas
53 304 Syntax error: Expected "." but "," found lcd.mbas
8 307 File "lcd.mcl" not found initialisemcu.mbas
The 2nd last line of the above Basic code should have been "next i"
0 102 Finished (with errors): 04 Aug 2010, 20:31:54 Project 201007.mbpav
Code: Select all
sub procedure LCD_Line_Reset()
'it is necessary to call this routine prior to each LCD line being processed.
dim i as byte
'
for i = 0 to (G_LCD_LINECHARS - 1)
G_LCD_Line[i] = ""
next
end sub
(I have removed other unnecessary messages)
259 1010 Hint: Unit "errors.mbas" has been recompiled errors.mbas
1 1015 Hint: Compiling unit "J:\mikroBasic Pro Projects\lcd.mbas" lcd.mbas
49 303 Identifier "end" was not declared lcd.mbas
49 301 "sub"is not valid identifier lcd.mbas
51 301 "procedure"is not valid identifier lcd.mbas
51 304 Syntax error: Expected "end" but "LCD_Scroll_Array_Reset" found lcd.mbas
51 304 Syntax error: Expected "sub" but "(" found lcd.mbas
51 304 Syntax error: Expected "end" but ")" found lcd.mbas
53 304 Syntax error: Expected "sub" but "dim" found lcd.mbas
53 304 Syntax error: Expected "end" but "i" found lcd.mbas
53 304 Syntax error: Expected "." but "," found lcd.mbas
8 307 File "lcd.mcl" not found initialisemcu.mbas
The 2nd last line of the above Basic code should have been "next i"
0 102 Finished (with errors): 04 Aug 2010, 20:31:54 Project 201007.mbpav
Regards,
Allen
Allen