1
00:00:00,600 --> 00:00:01,710
Hello and welcome.

2
00:00:01,710 --> 00:00:08,850
In this lecture we are going to learn how to trouble shoot the arrows you get.

3
00:00:08,850 --> 00:00:19,050
We are compiling your code so this is the code from our program we created.

4
00:00:19,080 --> 00:00:29,100
I'm going to deliberately cause some errors here so that we can learn how to troubleshoot it.

5
00:00:29,180 --> 00:00:32,230
For example here this line of code here.

6
00:00:32,240 --> 00:00:35,350
This code here belongs to this block of code.

7
00:00:35,540 --> 00:00:39,880
But what I'm gonna do I'm going to place it in here.

8
00:00:40,100 --> 00:00:43,200
In between here and see what happens.

9
00:00:43,430 --> 00:00:45,620
So I'll just copy

10
00:00:48,200 --> 00:00:51,270
and come here and paste it in there.

11
00:00:51,560 --> 00:00:53,180
All right.

12
00:00:53,210 --> 00:00:58,990
Just in then the ambit wherever you get red squiggly lines.

13
00:00:59,000 --> 00:01:06,140
It means the editor is not happy about some place complaining already you can see the squiggly lines

14
00:01:06,190 --> 00:01:06,780
make meat.

15
00:01:06,830 --> 00:01:10,970
It's not happy because he knows that death should not be there.

16
00:01:10,970 --> 00:01:13,350
It should come on the here.

17
00:01:13,430 --> 00:01:16,180
So if we compile this now.

18
00:01:16,190 --> 00:01:21,650
So anyway you see that squiggly line that should be a sign an indicator there's something wrong.

19
00:01:21,710 --> 00:01:29,280
If I try to compile this now it would give me an error she tells you say there were build errors.

20
00:01:29,520 --> 00:01:35,070
Would you like to continue and run the last successful build which is the last one.

21
00:01:35,160 --> 00:01:36,060
I'll say no.

22
00:01:36,060 --> 00:01:37,990
And then it will then tell me oh my God.

23
00:01:38,000 --> 00:01:41,030
So it's giving me a load of arrows.

24
00:01:41,200 --> 00:01:41,660
OK.

25
00:01:41,680 --> 00:01:44,530
Well we've You got invalid token.

26
00:01:44,760 --> 00:01:48,410
That means your code is somewhere it shouldn't be.

27
00:01:49,140 --> 00:01:49,640
OK.

28
00:01:49,650 --> 00:01:56,360
So look out for that is giving me the line number sir line 16 which is here which he's kind of like

29
00:01:56,370 --> 00:01:56,940
correct.

30
00:01:56,960 --> 00:02:05,190
Say if I look on line sixteen I can see what the what the editor this code what the Visual Studio is

31
00:02:05,190 --> 00:02:07,020
complaining about.

32
00:02:07,020 --> 00:02:13,660
So I'll just relocate this cut and place it back here where it should belong.

33
00:02:13,680 --> 00:02:20,070
It belongs in this block of code each curly braces represents a block of code.

34
00:02:20,790 --> 00:02:21,240
All right.

35
00:02:21,240 --> 00:02:24,130
So notice well time you get the yellow stripe here.

36
00:02:24,130 --> 00:02:26,100
It means you haven't saved something.

37
00:02:26,130 --> 00:02:29,550
So click on these folder here and save.

38
00:02:29,550 --> 00:02:31,040
So it's all turn green.

39
00:02:31,080 --> 00:02:35,490
I'm going to introduce another deliberate error.

40
00:02:35,490 --> 00:02:43,310
I'm going to take away the semicolon Semicolons are very important and it indicates where your code.

41
00:02:43,350 --> 00:02:49,620
And as you can see there's a red squiggly lines here indicates that it's not happy about something.

42
00:02:50,040 --> 00:02:58,080
So I'm going to run it anyway try and compiled by clicking start and it will give me a build error saying

43
00:02:58,080 --> 00:03:05,880
there were arrows in the build with our light to continue our say no H would not tell me they get told

44
00:03:05,940 --> 00:03:11,540
told me Here give me a clue that on line 13 ways the line 13.

45
00:03:11,550 --> 00:03:12,750
This is line 13.

46
00:03:12,750 --> 00:03:22,280
It is spot on their line 13 is telling me that is is expecting a semicolon asking where is it.

47
00:03:22,290 --> 00:03:23,530
I'm expecting this.

48
00:03:23,630 --> 00:03:25,600
So he called and that's what he's saying.

49
00:03:25,630 --> 00:03:34,000
And it tells me the name of the project the file program which is this line where the error occurs sometime.

50
00:03:34,020 --> 00:03:38,890
The line where the error cause may not exactly be spot on but you'll be near about.

51
00:03:38,910 --> 00:03:42,000
But in some cases it is spot on.

52
00:03:42,090 --> 00:03:45,210
Here you can see it is definitely spot on.

53
00:03:45,210 --> 00:03:52,800
So you can also see the sign with the squiggly line that's I just come here and introduce the semicolon

54
00:03:53,580 --> 00:03:56,490
and click start big things should compile.

55
00:03:56,490 --> 00:03:58,580
See my code as compiled.

56
00:03:58,650 --> 00:04:06,000
So while the code is running you get a memory management here which tells you how the memory is being

57
00:04:06,000 --> 00:04:08,570
used by the application.

58
00:04:08,600 --> 00:04:12,990
So I just click on X to end the application and the memory thing goes away.

59
00:04:13,470 --> 00:04:19,230
So that's basically how you can troubleshoot errors in your code sometimes.

60
00:04:19,260 --> 00:04:26,430
Is easy to or you can make mistakes live out simple things like semicolon and other bits and pieces

61
00:04:26,970 --> 00:04:33,570
you can normally get a clue because there be red squiggly lines and you can tell that there's something

62
00:04:33,600 --> 00:04:41,460
quite not right with a code but when you try to build it and you say no to the build it will display

63
00:04:41,460 --> 00:04:48,000
the arrows and give you a clue as to what line of code contains the arrow.

64
00:04:48,000 --> 00:04:56,880
So that is it for this lecture and this lecture I just introduce you to some basic troubleshooting concept

65
00:04:57,270 --> 00:04:59,040
for Visual Studio.

66
00:04:59,040 --> 00:05:00,050
Thanks for watching.

67
00:05:00,270 --> 00:05:01,080
I'm by for their.
