WEBVTT 00:02.100 --> 00:06.820 Welcome in this lecture, I'm going to show you how we can use the short, sweet statement. 00:07.500 --> 00:10.350 It's very similar to the short if statement, actually. 00:10.960 --> 00:12.180 OK, let's take it out now. 00:17.490 --> 00:18.180 Remember this? 00:19.420 --> 00:25.950 It just checks whether the airable is positive or negative or zero, as you can see, these airable 00:25.950 --> 00:29.310 here is declared out of the switch statements block, right. 00:30.500 --> 00:35.570 But actually, you could declare it using a simple statement right inside the switch statement. 00:36.610 --> 00:40.780 Like a short if statement, a switch statement can also use a simple statement. 00:41.050 --> 00:41.650 Let me show you. 00:44.940 --> 00:50.380 As you can see, I just moved the short verbal declaration just before the Salvages condition. 00:51.210 --> 00:54.060 Now, you may wonder where is the soldier's condition? 00:54.990 --> 01:00.640 Then use a simple statement, you also need to use a semicolon to separate the simple statement and 01:00.640 --> 01:06.990 the condition like this or go won't be able to recognize that whether this is a simple statement or 01:06.990 --> 01:08.790 is just a switch is condition. 01:09.760 --> 01:15.790 Now, this time, the Savages condition is true, since I want to find out a condition which yields 01:15.790 --> 01:16.660 a true value. 01:17.810 --> 01:19.490 Let's take a look at it in detail now. 01:22.700 --> 01:28.970 As I said, this highlighted part is a simple statement, then go get across a switch statement and 01:28.970 --> 01:33.620 if it has a simple statement, as in here, it would run it first and only once. 01:35.480 --> 01:41.720 Like a short statement, the short, sweet statement also uses a simple statement, the same rules also 01:41.720 --> 01:42.880 apply like scoping. 01:43.700 --> 01:49.430 I suggest you to watch the short lecture again, to learn more about the simple statements if you don't 01:49.430 --> 01:50.000 remember them. 01:50.900 --> 01:52.970 Here are some examples, simple statements. 01:53.750 --> 01:55.820 These all are simple statements. 01:56.360 --> 01:58.010 You can also use expressions. 01:58.290 --> 02:00.020 For example, you can call a function. 02:00.890 --> 02:02.610 All right, now let's continue. 02:06.550 --> 02:12.850 This is a separator, as I said, it's just a single semicolon token, it just separates the simple 02:12.850 --> 02:15.420 statement and the switches condition explanation. 02:16.150 --> 02:17.280 OK, let's continue. 02:20.320 --> 02:26.410 You know, this one, it is the switch conditioned expression now is true, but as you learned before, 02:26.440 --> 02:28.450 you don't need to type it if it's true. 02:29.590 --> 02:34.570 I'm just put it here to show you the whole statement with a separator, let's remove it now. 02:35.990 --> 02:41.930 All right, better actually, as the condition expression true is still there, it's just hidden. 02:42.870 --> 02:47.040 So that's why you still need to keep the semicolon as a separator there. 02:47.940 --> 02:49.290 All right, that's all. 02:50.330 --> 02:51.080 Congrats. 02:51.110 --> 02:55.010 Now we know how to use the short switch statements in the next lecture. 02:55.220 --> 02:57.000 I'm going to show you an example program. 02:57.800 --> 02:58.920 See you in the next lecture. 02:58.940 --> 02:59.330 Well, by.