Syntax errors

704 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
704
On SlideShare
0
From Embeds
0
Number of Embeds
22
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Syntax errors

  1. 1. SYNTAX ERRORS DUH!
  2. 2. We Can Make Mistakes in Code TooSub Main() Dim stopProgram As String I though I stopProgram = "no" dun did this While stopProgram = "no" ok . . . Console.WriteLine("HA HA!") Console.WriteLine("HA HA!") Console.WriteLine("HA HA!") Console.WriteLine("Do you want to stop?") stopProgram = Console.ReadLine() Console.WriteLine("GOODBYE!") Console.ReadLine() End SubEnd Module
  3. 3. We Can Make Mistakes in Code TooSub Main() Dim stopProgram As String stopProgram = "no" That’s better! While stopProgram = "no" Console.WriteLine("HA HA!") Console.WriteLine("HA HA!") Console.WriteLine("HA HA!") Console.WriteLine("Do you want to stop?") stopProgram = Console.ReadLine() End While Console.WriteLine("GOODBYE!") Console.ReadLine() End SubEnd Module
  4. 4. Visual Studio Will Tell You When You’ve Made a Mistake
  5. 5. Visual Studio Will Tell You When You’ve Made a MistakeVisual Studio has found that the While state has not been closed with an End While
  6. 6. Visual Studio Will Tell You When You’ve Made a MistakeVisual Studio will tell you where the error can be found.The line thecode can be found Be careful! You may have to dig around the code to see EXACTLY where the problem comes from
  7. 7. Visual Studio Will Tell You When You’ve Made a Mistake This is Line 8 . . . . . . But this is where the code is missing
  8. 8. Visual Studio Will Tell You When You’ve Made a Mistake You don’t to count the lines yourself Visual Studio has a line counter
  9. 9. We call this type error a . . . SYNTAX ERROR
  10. 10. Syntax Error Definition:In computer science a syntaxerror refers to an error in the syntax of a sequence of characters or tokens that is intended to be written in a particular programming language.
  11. 11. Syntax Error Definition: IF . .•YOU’VE MISSED SOMETHING OUT•YOU’VE TYPED SOMETHINGWRONG•YOU’VE WRITTEN SOMETHING INTHE WRONG ORDER YOU HAVE JUST MADE A SYNTAX ERROR!

×