background top icon
background center wave icon
background filled rhombus icon
background two lines icon
background stroke rhombus icon

Download "Delphi Programming - Full Beginner Crash Course"

input logo icon
Table of contents
|

Table of contents

0:00
Intro
0:31
The Delphi IDE
13:29
Your First Delphi Application
33:06
Comments
36:01
Images
37:36
Changing Attributes
47:38
Basic Output
54:30
Mathematical Operators
1:00:07
Basic Input
1:03:56
Setting Calendar Dates
1:14:11
Coding a Traffic Light
1:22:17
Variables
1:38:18
If Statements
1:42:09
If-Else Statements
1:44:10
Else-If Statements
1:47:50
Logical Operators
1:53:25
Inputbox
1:59:36
Constant Variables
2:08:09
Input-Process-Output
2:10:55
Building a Voting System
2:22:15
More Logical Operators
2:29:15
If ... In
2:32:57
Checkboxes
2:45:34
Radio Buttons/Groups
2:51:56
Case Statements
3:03:43
Case Lists
3:06:48
For Loops
3:10:04
Looping Through a String
3:16:40
While Loop
3:22:35
Timer
3:38:03
Using Val
3:43:43
Reading From a File - Part 1
3:47:36
Reading From a File - Part 2
4:07:51
Writing To a File
4:17:19
Custom Columns
4:24:19
What is an Array?
4:30:32
Creating an Array
4:37:11
Searching an Array
4:46:56
Constants
4:53:20
Procedures and Functions
5:14:21
What is a Database?
5:17:16
Connecting to a Database
5:27:20
DBNavigator
5:30:17
Inserting Data Into a Database
5:39:03
Editing Data in a Database
5:49:21
Deleting Data in a Database
5:56:42
Filtering a Database
6:07:26
Calculations With Databases
6:12:51
Sorting a Database
6:15:51
Searching a Database
6:21:19
Working with Multiple Forms
6:32:28
Bubble Sort
6:54:46
Text to Speech
6:57:46
Math Functions
7:18:51
String Manipulation Functions
7:32:36
String Manipulation Procedures
7:40:49
Message Boxes
7:49:31
More Functions & Procedures
8:01:40
Working with RichEdits
8:17:21
Outro
Video tags
|

Video tags

Steve's teacher
steves teacher
steve teacher
weeb
hd
tutorial
how to
programmer vibe
netsu blogs
teacher steve
delphi
crash
course
full
comunity edition
2020
gr 10
gr 11
basics
beginner
8 hours
programming
coding
all topics
handbook
school
learn
teach
string manipulation
functions
procedures
easy
education
long
everything
delphi 10
10.3
2021
2019
2018
updated
first
HD
720p
1080p
linux
windows
mint
19.3
20
windows 10
windows 7
10gb
Embarcadero
rad
rad studio
free
crashcourse
Subtitles
|

Subtitles

subtitles menu arrow
  • ruRussian
Download
00:00:01
and everyone welcome to your full course
00:00:04
thousand tutorials
00:00:06
so this beginner's course will if you're
00:00:08
following my homework school will cover
00:00:10
everything inside of this book
00:00:13
this six hour course
00:00:15
will teach you to get free great team
00:00:17
angular
00:00:19
and if you're not doing it because of
00:00:20
school
00:00:21
this course will help you get up and
00:00:23
running with adopted programming
00:00:24
language
00:00:27
now let's get started
00:00:35
and celebrity i'm so glad to see that
00:00:38
you're all joining in into the stealthy
00:00:40
tutorial so this is our first video and
00:00:43
we're not going to do any coding right
00:00:45
now i'm just going to show you around
00:00:48
and show you how everything works and
00:00:49
looks at what it does and stuff like
00:00:52
that so here you don't have to really
00:00:54
worry about anything this is just how
00:00:56
the the intro you know what you really
00:00:58
got to do is you got to go to file and
00:01:00
this is in most cases what you need to
00:01:02
do
00:01:03
and if you're working with delphi you'd
00:01:05
want to say blc forms and vcl forms and
00:01:09
applications
00:01:10
but if you're working with html stuff
00:01:12
you can go here but
00:01:13
since you didn't if you didn't follow my
00:01:15
html tutorial you'd never actually need
00:01:17
to go here
00:01:18
but
00:01:19
here is
00:01:21
the bcl forms and applications you click
00:01:23
on that you really need to worry about
00:01:26
any of the things that's here just yet
00:01:30
you just always started this one all
00:01:32
right these will come in later
00:01:36
now
00:01:38
we're just going to show you guys around
00:01:39
first off we have files
00:01:41
now after you've opened your file
00:01:44
you'd want to save it but do not say
00:01:47
save we're going to say save is not
00:01:48
going to save everything so you have to
00:01:50
say save all because it's going to save
00:01:52
the project as well as everything else
00:01:55
that might have kind of come with it
00:01:57
so you can always say shift control s
00:02:00
or you can say save all right here
00:02:03
for the first few videos i'm going to
00:02:05
say right here so you can get it
00:02:07
together into your guys heads that you
00:02:09
should be using this one
00:02:12
now let's click there
00:02:15
and then here
00:02:17
usually you can keep it like that it's
00:02:19
not a problem already first you find
00:02:21
your directory
00:02:22
so you're going to new because i am
00:02:24
already where i want to be
00:02:25
and now you just say folder and call
00:02:27
whatever you want so we're going to go
00:02:31
the selfie
00:02:33
test
00:02:35
we're going to our first
00:02:37
folder and then here you can just rename
00:02:40
it to whatever you want you can even
00:02:41
leave it like that but i suggest you go
00:02:44
if or in
00:02:45
whatever the name should be so we're
00:02:47
going to test and if it's the unit which
00:02:49
is usually the first one
00:02:51
you go underscore you
00:02:53
and you also see here it says you right
00:02:55
there for unit and you just put you
00:02:58
there now you don't need to do this but
00:02:59
it makes it easier to navigate
00:03:02
just say save and then you're going to
00:03:04
have to save the project now just do the
00:03:06
same thing f r m with the name
00:03:10
underscore and instead of u you go p
00:03:13
because p is usually the one you want to
00:03:16
open
00:03:17
so just that just makes it easier you
00:03:19
know otherwise you're going to have to
00:03:20
read it
00:03:22
the like
00:03:23
dot dpr
00:03:25
oj and you don't always want to do that
00:03:28
so you just go save
00:03:30
and you have saved it correctly
00:03:33
now that's about all you have to worry
00:03:34
about in here the reason really
00:03:36
important i never use it you can use it
00:03:40
and nothing really important here we
00:03:42
don't have to worry about it
00:03:44
search
00:03:45
nothing really to worry about
00:03:47
actually
00:03:49
view
00:03:50
you never actually use this either but
00:03:52
maybe you will find something that
00:03:55
will fit to your liking and then you
00:03:57
will use this but otherwise you don't
00:04:00
really have to worry yourself with this
00:04:01
either
00:04:03
refactor i never use this now probably
00:04:06
never will
00:04:08
so you can decide if you want to use
00:04:10
this i don't know what's going on in
00:04:12
here so
00:04:13
yeah project here you can find a few
00:04:16
cool things for example compiling it
00:04:18
building it but you don't need to
00:04:20
actually ever use these unless you're
00:04:22
creating something specific to
00:04:24
like
00:04:25
you know
00:04:26
actually use
00:04:28
for a game right here i've created a
00:04:30
game
00:04:31
also here's the folders where you can
00:04:32
just stack
00:04:34
as you can see there's underscore p
00:04:36
and stuff so easy to read now
00:04:39
what i have done
00:04:41
is i've created a game
00:04:44
now here
00:04:47
and
00:04:48
basically
00:04:50
if you say build you build this exe
00:04:53
dot exe you know and you can play the
00:04:56
play whatever you used
00:04:58
so that's
00:05:00
what all this is for
00:05:02
then you have the options
00:05:03
option which is uh pretty useful as well
00:05:07
for you remember this game i just showed
00:05:09
you
00:05:11
now you might be wondering how do you
00:05:13
change
00:05:14
how it looks how do you change the icon
00:05:16
and stuff here now there's you can
00:05:18
change the icon here
00:05:19
change the title and
00:05:21
go make a help file
00:05:24
you can change the version info
00:05:27
now this is if you're creating like
00:05:28
applications and stuff for actual people
00:05:31
this could be useful
00:05:33
but yeah that's about all i use here you
00:05:35
actually bring it you'd actually never
00:05:37
have to use this either
00:05:39
and then you have to run where you can
00:05:41
actually run it or run it
00:05:43
without debugging
00:05:45
but you don't actually need to click
00:05:47
this you know you can just click this
00:05:49
which is also wrong run doesn't really
00:05:51
do anything right now it just opens it
00:05:54
up and shows you this is how it looks it
00:05:56
doesn't have
00:05:57
why did you do that
00:06:00
it doesn't have anything why are you oh
00:06:02
wait okay
00:06:03
see this is basically the dot exec can
00:06:06
you stop doing that why are we doing
00:06:08
that the dot exe file
00:06:14
so you don't have to click this but you
00:06:15
can if you want i just start clicking
00:06:17
this
00:06:19
they have the components which i never
00:06:21
use either
00:06:23
two with i never use other windows and
00:06:25
help i never use any of those
00:06:28
then most of these
00:06:30
you can find for yourself for example
00:06:31
this is save control s
00:06:34
you can find it here all of this you can
00:06:36
find that here
00:06:38
this you can also find here in view
00:06:41
like
00:06:44
i'm sure you find somewhere here
00:06:47
there's nothing special about it
00:06:49
saying none won't do anything
00:06:51
going undocked it's just making
00:06:53
everything it says undocked
00:06:55
you just move it around like let's say
00:06:57
you have a bunch of things you got to
00:06:58
check out you move around
00:07:01
mess with it not really important it
00:07:03
does very confusing things then you get
00:07:05
the debug layout
00:07:08
which is uh
00:07:10
nothing special it's just what you get
00:07:11
normally and they also get the default
00:07:13
layout which is also nothing really too
00:07:15
special
00:07:16
but i just go with the default outs
00:07:18
because it's the easiest of them all you
00:07:20
can see which one you want which one you
00:07:22
like you know
00:07:24
up to you we'll get to this we'll get to
00:07:26
this
00:07:27
and here are all your projects
00:07:31
now this is just a project you can add
00:07:34
another project here for example and
00:07:37
i can add this i can put it there but
00:07:39
i'm not going to
00:07:41
and then you can add a project here oh
00:07:43
wait let's do it let's show you what to
00:07:44
do so let's say you add a project here
00:07:47
so you can like
00:07:48
so it has anyways been added usually it
00:07:50
will have an extra one here but i said
00:07:52
close
00:07:53
so here it would usually be that you can
00:07:55
things and it's both projects you know
00:07:57
but this one which usually
00:07:59
interfere with this one you can change
00:08:02
it here
00:08:03
somewhere but i don't do that i'll just
00:08:05
say remove
00:08:07
remove project
00:08:08
this will remove that project and you'll
00:08:10
only have your one project there which
00:08:12
is
00:08:13
mostly useful just for later on yeah
00:08:15
because you never know you might
00:08:16
accidentally do that
00:08:18
then here you can just resize the form
00:08:20
the form is nothing reform is actually
00:08:22
the whole application i can't say
00:08:24
nothing special
00:08:26
see if you resize it this suddenly
00:08:28
becomes bigger
00:08:31
this here is where it will pop up if
00:08:33
this is in the middle it will pop up in
00:08:34
the middle of the screen if it's there
00:08:37
there and stuff like that so let's make
00:08:38
it pop up right there here
00:08:41
so if i run it now
00:08:45
it opens up here which i find really
00:08:47
annoying usually what i do is i click on
00:08:50
it and here at object inspector
00:08:52
i go to
00:08:55
either windows state and make it
00:08:57
maximize
00:08:58
or i go to
00:09:01
position here
00:09:03
and i just say
00:09:04
make it into the center desktop sensor
00:09:08
there's another one but i just
00:09:10
pick whichever one works for me because
00:09:12
i don't have two screens or anything so
00:09:13
it doesn't bother me so now i can move
00:09:14
it around and stop but it'll always stay
00:09:16
there why does it do that
00:09:18
it's really annoying
00:09:21
anyways so yeah then you have that
00:09:24
so now let's get it to
00:09:28
hell now let's get to the two places
00:09:31
now here is where you can find things
00:09:33
like
00:09:34
buttons
00:09:37
memos
00:09:40
panels which i don't necessarily like
00:09:42
using
00:09:44
a bunch of things which is pretty cool
00:09:46
another thing to notice if you
00:09:48
accidentally like put your memo on the
00:09:51
panel
00:09:52
um
00:09:54
let's create an
00:09:56
another memo
00:09:58
memo if you accidentally put your memo
00:10:01
or a button or whatever on the panel
00:10:04
you'd see it's quite annoying because
00:10:06
it's on the panel
00:10:07
but you know it makes it looks nice and
00:10:09
stuff later on
00:10:11
and it does have special effects and
00:10:13
stuff
00:10:14
but if you do this and you don't want it
00:10:16
here it's annoying because it can't go
00:10:18
out and stuff
00:10:19
let's delete this mirror because this
00:10:20
mirror is important you can just go to
00:10:22
edit
00:10:23
delete then maybe it's gone but see if
00:10:25
you want this one to go away all you're
00:10:26
going to do is you're going to go here
00:10:28
to this the form structure
00:10:31
and this is basically how everything is
00:10:33
built like see that's with little
00:10:36
children and stuff like that
00:10:38
like this is a parent this is his
00:10:40
children and this is the parent's
00:10:41
grandchild but you can make this
00:10:43
grandchild the parent's child by
00:10:45
dragging it to the parent
00:10:48
now as you can see the memo is no longer
00:10:49
part of the panel
00:10:51
so we can just put it wherever we want
00:10:53
good thing to note because that can
00:10:54
become really annoying if you don't know
00:10:56
how to do it
00:10:58
now
00:10:59
we can go here after we have covered
00:11:01
basically all that
00:11:03
here we can just change things for
00:11:05
example the name which we will get to
00:11:06
later when coding
00:11:08
usually for button we go btn and then
00:11:10
the name like
00:11:12
press button press
00:11:15
and then to change the caption you go to
00:11:18
caption and you remove the button
00:11:20
there now just press
00:11:23
now this doesn't do anything yet it's
00:11:25
just a bunch of
00:11:26
components on a form
00:11:29
you can do whatever you want isn't going
00:11:31
to do anything
00:11:36
see this is just so you can edit how
00:11:37
everything here looks you can change the
00:11:39
colors and the size and stuff like that
00:11:41
you can all do you can do all of this
00:11:43
inside the code
00:11:44
um like in this game right here i did a
00:11:47
lot of things just inside of the code
00:11:49
um especially here when the first
00:11:51
version came out the beta version this
00:11:54
is all like sit inside of the code like
00:11:57
when the game starts all of that is like
00:12:00
set to a different place
00:12:04
with the code
00:12:06
now we're not going to start the code
00:12:07
just yet we're going to do that in the
00:12:09
next video
00:12:10
now i'm just showing you how everything
00:12:12
works these three you don't really need
00:12:13
to mess with i never mess up them
00:12:15
because
00:12:17
you know i'm not i never use them so i
00:12:19
never mess with them
00:12:21
then you have the code which we will get
00:12:25
to later on and how to edit it and
00:12:27
stuff like that because right now
00:12:29
you can't do anything really it's just a
00:12:31
bunch of pieces of stuff
00:12:33
now what you can do is you can either
00:12:34
press code or design and it will swap
00:12:37
between the two or you can press f12 and
00:12:41
it will swap between the two as well
00:12:44
now here also on the object inspector
00:12:46
it's nice to note that you have events
00:12:49
for example on the press button we have
00:12:52
like on click event like if they click
00:12:54
on it
00:12:55
or
00:12:57
where's that
00:12:59
like in drag but after a dragon they
00:13:01
stop
00:13:03
something will happen
00:13:04
on exit on entry in a
00:13:06
bunch of useful things we'll also get to
00:13:08
this later inside the code
00:13:10
okay back to here
00:13:12
now here you also have history but i
00:13:14
never use it
00:13:16
because i never need to
00:13:18
now yeah next time we'll get to coding
00:13:21
and how to
00:13:23
start with the basics for example coding
00:13:25
a button
00:13:27
and a shape
00:13:34
so
00:13:35
today we will be creating this
00:13:39
it's a basic program which is sends the
00:13:41
ball up and down
00:13:43
it has a label
00:13:45
two buttons
00:13:47
and one bit button
00:13:50
now i'll be explaining all these later
00:13:52
and also has the shape
00:13:54
now we'll be trying to create it almost
00:13:56
exactly like this doesn't need to be
00:13:58
exactly but we can kind of create it
00:14:00
exactly like this
00:14:02
so first create your form new
00:14:06
vcl forms application and then the ship
00:14:09
button
00:14:11
then save it
00:14:14
save all
00:14:19
you need choose your directory
00:14:29
probably want i'm going to call the page
00:14:31
i'm explaining to you guys
00:14:34
then let's go for in
00:14:36
game
00:14:37
underscore build a friend
00:14:40
the ball game
00:14:42
you should know what it is when you go
00:14:43
in okay
00:14:44
underscore you
00:14:46
you can copy that if you want
00:14:51
and then underscore p
00:14:54
and now you have saved it
00:14:57
now let's see so it has
00:14:59
label
00:15:00
two buttons
00:15:01
a bit button
00:15:03
and
00:15:04
a circle
00:15:06
so we have a
00:15:08
label
00:15:10
two buttons
00:15:13
one bit button
00:15:16
and then one shape
00:15:22
okay
00:15:24
so let's first do this let's get
00:15:26
everything out there
00:15:28
okay
00:15:29
so before we try to everything where it
00:15:31
should be let's first try and make this
00:15:35
into
00:15:37
this because as you can see they're not
00:15:39
matching
00:15:42
so first off now you can do this
00:15:46
but this isn't as accurate let's say you
00:15:49
want specifics you know
00:15:51
then this isn't going to now first of
00:15:54
all you select the form because
00:15:56
sometimes you are selected to want these
00:15:58
and then it might not work as well so
00:16:00
first you select the formula
00:16:01
then let's go
00:16:03
to the height
00:16:06
now the object inspector h should be
00:16:11
there
00:16:12
we can make this 330
00:16:15
it will probably be 330 pixels but it
00:16:18
doesn't really matter in this context
00:16:21
and then you change the word to 30.
00:16:26
now that should look
00:16:28
pretty much like this
00:16:30
a little different but there will
00:16:32
probably
00:16:36
now
00:16:38
let me put the label there
00:16:40
there
00:16:42
now let's see what else does it have
00:16:45
let's see what else does it have here
00:16:48
uh so it's font seems to be comic sans
00:16:52
so let's go here
00:16:55
and then we go to the font now you can
00:16:57
change all this in the code
00:16:59
but
00:17:00
because you're new we'll be using object
00:17:01
inspector first so then you go to fonts
00:17:05
you click on these three buttons right
00:17:07
here
00:17:08
and you search for comic sense up here
00:17:10
select that make the
00:17:12
yeah make the size 10 so it's a little
00:17:14
bit bigger than that
00:17:16
and then you go okay
00:17:18
now as you can see everything here
00:17:20
changes
00:17:21
[Music]
00:17:23
then let's see what else would there be
00:17:25
now this one
00:17:28
has a catch in my first stealthy
00:17:30
program now select your form and go to
00:17:33
caption
00:17:36
my
00:17:38
first
00:17:40
healthy
00:17:42
program
00:17:44
yeah my first time program
00:17:47
now i believe we can go on to the label
00:17:52
oh wait wait let's first shake
00:17:54
everything how does all this look
00:17:56
okay let's first do the label so you
00:17:59
change the caption
00:18:00
to it says click it button
00:18:05
click
00:18:06
a
00:18:09
button
00:18:11
okay so there is the label now here it
00:18:15
is
00:18:16
around about here
00:18:18
so we can reshape this
00:18:21
you look bigger
00:18:23
this you can change how big you want i
00:18:25
would like it to
00:18:26
be and we can change about
00:18:30
that
00:18:32
there now they look basically the same
00:18:39
all right
00:18:40
now this is up to you you can
00:18:42
actually make it whatever size you want
00:18:44
actually
00:18:47
also another thing to note is you can
00:18:48
press ctrl
00:18:49
and lift right up and down to move it
00:18:52
like slightly sideways upwards downwards
00:18:55
you know
00:18:57
if you can't get it to exactly where you
00:18:59
want it for example see you kind of get
00:19:01
kind of constantly there but you don't
00:19:02
want it
00:19:04
control and the society you want to go
00:19:06
to and
00:19:08
easy as part am i right
00:19:12
and then its shape is around here
00:19:16
okay so now we can start with the first
00:19:18
button
00:19:20
now we open it up it says up
00:19:23
so first let's let's name all things
00:19:26
firstly because this makes the whole
00:19:27
process easier to first name it
00:19:30
so then we go to name
00:19:32
btn
00:19:36
go to button2 and make this
00:19:39
btn
00:19:40
close
00:19:43
close
00:19:44
turn down
00:19:47
all right then the bed button we go
00:19:51
bit btn
00:19:54
and
00:19:55
close
00:19:58
okay so now we have this and so we can
00:20:01
rename this one to
00:20:04
shp for shape
00:20:06
and then
00:20:08
circle
00:20:12
okay
00:20:13
so now we can go to the captions
00:20:16
so we can just go there
00:20:19
and always there
00:20:21
see just go to the object inspector
00:20:23
makes everything easy
00:20:25
and you can just quickly change whatever
00:20:27
you want now of course as i said you
00:20:29
could do this in the code but if you
00:20:31
don't have to
00:20:32
why do that
00:20:34
well well i i like to do it like that
00:20:36
but since we are new here we gotta stay
00:20:38
with now
00:20:40
a bit button isn't the same as
00:20:43
a button
00:20:45
now a button you can code you can create
00:20:47
a bit button as well but a bit button
00:20:49
you can give a specific thing to do
00:20:52
like here they give gave their bed
00:20:55
button the specific thing to close
00:20:59
so if i'm going to click on this it will
00:21:01
close
00:21:02
no no no need to go reopen it
00:21:07
as you can see here
00:21:09
so this one should do the same
00:21:12
so what
00:21:14
with the bit button you select it
00:21:16
ending
00:21:17
what are you doing
00:21:21
okay
00:21:22
you select it and you go down to kind
00:21:27
you click on this button right here and
00:21:30
you go to close
00:21:34
now it should look basically the same
00:21:37
the reason we i noticed a bit button is
00:21:39
because it has this little image here
00:21:41
red buttons can have little images
00:21:44
i don't know why but it's kind of cute
00:21:46
you know
00:21:48
so yeah
00:21:51
so the first button here seems to be
00:21:53
enabled as you can see here
00:21:56
and this one is disabled so you can't
00:21:59
click on it this one you can click and
00:22:01
then this one becomes enabled we'll get
00:22:03
to the code with this later so first
00:22:05
let's
00:22:06
disable this one
00:22:08
so you click on it and you go to enabled
00:22:11
right here
00:22:12
and you take it to false
00:22:15
now
00:22:16
this one should be disabled when we
00:22:18
started out
00:22:21
then
00:22:23
we can go i think we can continue to the
00:22:25
shape
00:22:26
it should be this
00:22:27
now the shape seems to be a circle so
00:22:30
you select it
00:22:31
and you go to
00:22:33
shape
00:22:35
now this is up to you you can animate it
00:22:37
an ellipse or a circle
00:22:40
it is truly up to you a circle can only
00:22:44
change its radius and the ellipse can
00:22:46
only change it's kind of changes height
00:22:48
and work if you follow my html tutorials
00:22:51
you'll kind of understand this
00:22:53
now
00:22:55
a circle if you change the height the
00:22:56
width will change along with it so if
00:22:58
you change the height to 60 the roof
00:23:00
will become 60 as well but very much if
00:23:02
you change the height to 60
00:23:05
the work will stay the same as what it
00:23:07
was
00:23:08
so let's go to ellipse you can choose
00:23:10
circle if you want it's actually faster
00:23:12
but for the sake of the video we're
00:23:14
going to choose a lens
00:23:16
now we're going to change the
00:23:19
height of this
00:23:21
to 14
00:23:24
which is 40
00:23:26
and then the width will also change to
00:23:29
14.
00:23:30
now we have a 40 by 40
00:23:34
ellipse
00:23:37
okay
00:23:38
now
00:23:40
here
00:23:41
it's red
00:23:43
so to get that you go to brush you click
00:23:46
on this plus sign right here
00:23:48
and you'll have the option to color it
00:23:51
you click on this button right here
00:23:53
inside and you choose cl red
00:23:58
isn't that beautiful
00:24:00
so then
00:24:01
we can start positioning it
00:24:05
so let's make lift
00:24:08
around 160 maybe
00:24:09
[Music]
00:24:13
and we make the two
00:24:16
what about 120
00:24:18
the top is 120.
00:24:23
we make the top 200
00:24:26
yeah that's better
00:24:27
okay
00:24:29
so
00:24:30
here is what we have here
00:24:34
it looks basically exactly the same
00:24:36
right
00:24:38
but if you're going to run this one
00:24:46
you will see they do look exactly the
00:24:49
same
00:24:50
but there's one difference if i click up
00:24:52
here and down here the ball moves
00:24:55
but if i click up here
00:24:58
nothing happens
00:25:01
so let's close this
00:25:05
now we can start coding
00:25:08
so with a button you can either go to
00:25:11
the events
00:25:12
and click on the
00:25:14
on click you can double click here
00:25:16
or
00:25:17
in the foster way and just double click
00:25:19
on that button
00:25:21
and it will automatically create on
00:25:23
click
00:25:24
procedure
00:25:26
now here is where we start programming
00:25:29
thankfully selfie is in fairly easy
00:25:32
language to learn
00:25:34
um
00:25:35
everything is super easy to understand
00:25:38
so first off
00:25:40
as you can see
00:25:41
here
00:25:42
the app button
00:25:45
since thing since the baller so the
00:25:47
first thing you should do is we should
00:25:49
save the shape
00:25:51
now we called the shape
00:25:56
here at the name
00:26:00
there
00:26:01
shp circle
00:26:04
so here we can go
00:26:06
this
00:26:08
hp circle
00:26:12
now uh easy thing to notice you can
00:26:14
either do that
00:26:15
or
00:26:17
you can press ctrl
00:26:19
and space
00:26:20
and then sh and there you pop up account
00:26:23
press enter and you have
00:26:25
your name
00:26:28
now when you press
00:26:30
the button up your circle should be
00:26:32
going up correct
00:26:34
so you say dot
00:26:36
and
00:26:37
this is where it can become easy so we
00:26:39
are still selected at the circle
00:26:42
so
00:26:43
right now its top is 200
00:26:46
and as we all know
00:26:47
changing the top changes where this is
00:26:50
so if i change this to 20
00:26:54
it will go up
00:26:55
but if i change it to 200 it will go
00:26:57
back down
00:27:00
so
00:27:01
we go shape circle
00:27:03
dot
00:27:04
top
00:27:06
and then
00:27:08
this is a becomes
00:27:11
it is the two dots and an equal sign
00:27:16
and then you just go
00:27:19
between
00:27:21
so it's top becomes string
00:27:23
now do you see what i just did there
00:27:27
let's do that
00:27:28
it was here
00:27:30
now if i press ctrl and d
00:27:34
it just shifts it upward
00:27:36
the alpha has this beautiful thing of
00:27:38
impress control and being
00:27:41
it makes your code just looks so much
00:27:44
better and easier to read i highly
00:27:46
suggest you do that because if you don't
00:27:49
it will just look unprofessional
00:27:52
so delphi kind of makes your life easier
00:27:54
for you
00:27:56
now let's quickly run it
00:27:58
and you probably saw here that this
00:28:00
changed to green one side
00:28:03
this is when i press ctrl s
00:28:05
so here i press ctrl d it changes
00:28:07
together because it everything is
00:28:09
unsaved so ctrl and s saves it and turns
00:28:13
it green
00:28:14
now let's quickly run this
00:28:18
and let's see if i press up
00:28:21
you see it changes to 20
00:28:26
so yeah we can close that
00:28:29
but you see the problem is when we press
00:28:32
up here
00:28:35
this one comes enabled and this one
00:28:36
becomes
00:28:38
disabled
00:28:40
so what we should do here is we should
00:28:42
go
00:28:44
btn up
00:28:46
dot enabled
00:28:48
now as i showed you before
00:28:50
you go here and you go to the objectives
00:28:52
pane too
00:28:54
the name
00:28:55
that we chose
00:28:56
is yeah
00:28:59
beating up
00:29:01
now beating up
00:29:03
dogs and then here is the enable which
00:29:06
is set to true
00:29:09
now cp enabled
00:29:11
beaten up dot enable then you just make
00:29:13
it false
00:29:16
now there's just thing in programming
00:29:18
where true and false is basically like a
00:29:20
one to zero
00:29:21
false is where it would be zero and true
00:29:24
is where it's won
00:29:26
now i don't actually need to explain
00:29:27
this to you but it's for future
00:29:29
reference
00:29:30
so if something is enabled then it has a
00:29:33
one and the computer reads it as okay so
00:29:36
this thing can be used
00:29:38
when you create false it gets a zero and
00:29:40
then the computer is like huh this is
00:29:42
zero it can't be
00:29:44
so
00:29:45
yeah
00:29:46
and then btn
00:29:48
down
00:29:50
dot enabled
00:29:52
becomes true
00:29:57
now if you were a bad programmer
00:30:00
you would probably do something it would
00:30:02
probably look something like this
00:30:04
just untidy
00:30:06
you don't want that there's controlling
00:30:09
d just makes all them beautiful
00:30:11
now this space here doesn't matter
00:30:14
i like to keep mine apart if
00:30:17
it's it just looks better you know
00:30:19
but there
00:30:21
you don't need
00:30:22
so also another internet is
00:30:25
we can we can do that later
00:30:28
okay so
00:30:29
now let's quickly try and see what we
00:30:31
get
00:30:32
so now if we press up
00:30:35
it becomes the same and this one becomes
00:30:37
enabled but it doesn't work
00:30:40
so down is basically the same thing
00:30:43
so you go to the down button you double
00:30:45
click on it and here you go
00:30:47
so shp circle dot top
00:30:51
top
00:30:53
becomes 200
00:30:56
then btnr
00:30:58
dot enables
00:31:00
becomes
00:31:02
true
00:31:03
and bt in
00:31:05
down dot enabled
00:31:08
becomes
00:31:09
false
00:31:10
super positive
00:31:12
now the healthiest is nice thing is
00:31:14
about where
00:31:15
it doesn't care where anything is
00:31:18
actually
00:31:19
now with any programming language it
00:31:22
does sometimes matter where these these
00:31:24
are but for those of you that has no
00:31:26
experience with programming this doesn't
00:31:28
really matter in most cases about where
00:31:30
it is or not in these cases in most
00:31:33
cases it actually does but this specific
00:31:35
case where this is it doesn't matter you
00:31:38
can put this one here at the top
00:31:40
it doesn't matter
00:31:42
as long as it's between that begin and
00:31:44
end
00:31:45
if you don't do it just really doesn't
00:31:47
matter
00:31:49
okay so now let's try it again
00:31:56
down
00:31:57
up
00:31:58
down and let's quickly see how the other
00:32:00
one looks
00:32:02
there and there
00:32:06
so
00:32:09
they look exactly the same to me now
00:32:11
right
00:32:12
now you might be thinking
00:32:14
let's do something
00:32:15
what about the coolers
00:32:17
don't need to worry this is where the
00:32:20
bed button becomes really nice
00:32:22
it codes itself basically
00:32:25
so close
00:32:27
easy as that
00:32:30
now you might be thinking how do i know
00:32:31
if i mean a problem somewhere and it
00:32:34
doesn't work and i don't know how to fix
00:32:35
it now first thing that would happen is
00:32:38
let's remove that this will come up and
00:32:40
it will tell you which line it is like
00:32:42
around 34 and 20 is how much like where
00:32:46
which column not how much character is
00:32:47
up
00:32:48
just excuse that noise in the background
00:32:51
now
00:32:52
even if you run this
00:32:54
it will give you an error
00:32:56
and it will show you exactly where it is
00:32:58
and here it will also tell you what's
00:33:00
wrong
00:33:02
so
00:33:03
there fixed
00:33:12
so
00:33:13
today we'll be covering comments in
00:33:15
delphi this shouldn't be a long video at
00:33:17
all
00:33:18
now
00:33:19
comments are basically things
00:33:21
that
00:33:23
remove that you can use like give
00:33:25
yourself some tips like
00:33:27
um
00:33:28
what's that
00:33:30
for example
00:33:31
slash
00:33:33
this is a one line comment
00:33:36
it only covers one line so you can be
00:33:38
like a
00:33:40
sit
00:33:42
um
00:33:43
shaped
00:33:47
position
00:33:50
but this won't be red
00:33:52
and as you can see there are no problems
00:33:54
but if you were to put this without a
00:33:56
comment
00:33:57
like here
00:33:59
then you would immediately get a bunch
00:34:01
of
00:34:02
errors saying hey wait what's this
00:34:05
so
00:34:08
this
00:34:10
really helps you if you just want to
00:34:11
cover one line with a comment
00:34:15
now you can put a comment anywhere
00:34:18
um but these are put above
00:34:22
below or after
00:34:24
what you wanted to say
00:34:26
because if you're going to put this
00:34:28
in front of what you wanted to say
00:34:31
then this is also going to become a
00:34:32
doubt and you don't want that
00:34:38
now
00:34:41
uh comments are extremely useful correct
00:34:43
but if you have like let's say you want
00:34:45
to comment out these lines because
00:34:46
you're not going to use them you want to
00:34:48
use something else this is this is lines
00:34:50
that you never want to use we can say
00:34:52
or let's say you want bt and up to be
00:34:56
enabled but always stay enabled or wait
00:34:58
wait let's just comment these two out
00:35:00
okay then
00:35:03
you can already do that and you'll
00:35:05
comment out both of them with this but
00:35:07
if let's say there's like 50 likes then
00:35:09
would you really want to do this 50
00:35:11
times
00:35:12
so
00:35:14
you can use one of these brackets
00:35:20
and
00:35:21
close it off with one of those
00:35:24
and as you can see
00:35:25
these are not comments and they won't be
00:35:27
red so b10 update enabled becomes true
00:35:29
but it won't become true because
00:35:34
you see it won't become true because you
00:35:36
commented it out
00:35:38
now
00:35:40
these are the most
00:35:42
popular comments to use in healthy
00:35:44
but if you really want to you can always
00:35:46
use them a bracket
00:35:49
with a store and a store and a bracket
00:35:52
this does exactly the same thing as this
00:35:56
but um
00:35:58
yeah but this one is more effort so i
00:36:00
suggest you use this one
00:36:07
so today we're going to be focusing on
00:36:09
the delty images
00:36:11
so here in this folder as you can see
00:36:14
we have an image
00:36:16
along with our project
00:36:19
nothing special about it
00:36:22
now we're going to see how to load it in
00:36:25
here now i gotta say images are pretty
00:36:27
easy all you gotta do is just say
00:36:30
image
00:36:31
you add image
00:36:34
then you can resize it to whichever size
00:36:36
you want you just go like that
00:36:40
and then all you got to do is you click
00:36:42
on it
00:36:43
and you find the picture in the object
00:36:46
inspector
00:36:47
inspector and you click on the three
00:36:49
dots right here at the side
00:36:52
you go here and you say load
00:36:55
it will open up in the folder
00:36:58
and see it's a lot easier than html
00:37:02
so then you just click on it you say
00:37:04
open
00:37:05
and there it is you don't say save or
00:37:07
clear anything you just say okay
00:37:09
now you might be wondering wait what i
00:37:11
didn't expect that to happen
00:37:14
but all you got to do is just go to go
00:37:16
down
00:37:17
remember you should still be selected
00:37:19
and then here at stretch you should make
00:37:21
that true
00:37:22
and there you go
00:37:24
that will basically stretch itself so it
00:37:27
can be shown
00:37:30
and that is how you add an image guys
00:37:39
okay
00:37:40
so today we'll be working through this
00:37:43
now um
00:37:45
this form is basically just free edits
00:37:49
three labels one bit button
00:37:52
this butt button might say reset
00:37:55
but its kind is retry
00:37:59
so remember just put a retry and then
00:38:01
change the caption to reset
00:38:05
and then we have three buttons of
00:38:07
records english and spanish
00:38:10
now
00:38:11
if the person clicks on afrikaans this
00:38:14
should change to africans person clicks
00:38:16
to english if you change to english or
00:38:18
it should stay in english if it is
00:38:20
really english
00:38:21
and if you click on spanish it should
00:38:23
change spanish
00:38:25
and if you click reset
00:38:27
this should be cleared
00:38:29
but when you start up this shouldn't be
00:38:31
in it okay
00:38:33
so first thing we're going to do is
00:38:34
we're going to remove that when we start
00:38:36
up the
00:38:37
whole
00:38:38
program because we're starting if we
00:38:40
start up now we're going to have a
00:38:42
little bit problem with the
00:38:44
you know just
00:38:45
it's all going to be inside we don't
00:38:47
want that so and this doesn't actually
00:38:49
work it even if it's a bit button its
00:38:51
code doesn't exist just yet
00:38:54
so
00:38:55
let's get started click on the form
00:38:58
go to its advance now you can either
00:39:01
choose
00:39:02
on activate
00:39:04
or on create
00:39:07
to be honest i don't know what the
00:39:08
difference is i just usually select on
00:39:11
activate
00:39:12
while everybody else decides to rather
00:39:14
select
00:39:15
oncreate but to me there's no difference
00:39:18
if you start up the application it does
00:39:19
everything the same
00:39:21
so let's start up
00:39:23
now we have finally started up or on
00:39:25
activate
00:39:27
but now what
00:39:28
so we want to get rid of the insides
00:39:32
now with an edit
00:39:35
it's inside or made
00:39:38
with
00:39:40
text so the inside of that edit is a
00:39:43
text
00:39:44
now since this shouldn't be doing
00:39:46
anything specific we don't need to like
00:39:48
assign it to any variables which we
00:39:50
haven't done yet but we'll get there
00:39:52
so let's
00:39:53
press f12
00:39:55
now we know this one is the edt name so
00:39:59
edt name
00:40:01
dot text
00:40:03
becomes
00:40:06
i can just do that
00:40:08
or if i'm correct we can go dot
00:40:10
clear
00:40:13
so let's see will that clear work
00:40:17
yes dot clear works so you can either
00:40:20
use that
00:40:21
or you can use edt
00:40:24
h
00:40:25
dot
00:40:26
text
00:40:28
and make it equal to nothing
00:40:36
as you can see it works as well
00:40:40
now
00:40:42
in i know in some other languages
00:40:45
like java
00:40:47
you have to use these
00:40:49
if you want to create something like
00:40:51
this
00:40:52
but take note into healthy you don't
00:40:55
also in like javascript you can use like
00:40:57
this
00:40:58
this
00:41:00
and
00:41:02
this it all work the same
00:41:05
but
00:41:07
in delphi you can only use
00:41:09
these so take note of that
00:41:14
edt surname dot clear
00:41:18
all right so now we should have the
00:41:20
first part perfectly done
00:41:24
yes
00:41:29
now let's do the reset
00:41:34
now this is basically a copy and paste
00:41:38
literally that that's all this is
00:41:45
so if you go like that like that and
00:41:49
like
00:41:51
like that
00:41:52
if we say reset it works perfectly
00:41:55
because it does exactly the same it
00:41:57
clears everything out
00:41:59
now it is
00:42:01
good to program
00:42:02
as and don't do and not doing this
00:42:04
because this doesn't look
00:42:07
it doesn't look clean we can say
00:42:09
now you should either make all of them
00:42:11
like this or
00:42:13
all of them like
00:42:14
this but for the sake of the lesson we
00:42:17
did it here like that
00:42:19
but here since we have already covered
00:42:21
that we can just do what's best
00:42:25
don't clear
00:42:28
it's automatically in english
00:42:31
so let's first start with when we press
00:42:33
off recons
00:42:35
oh well
00:42:36
now a label uses a caption
00:42:40
but one thing i forgot to add was the
00:42:43
label name
00:42:45
you don't it's not necessary to add a
00:42:47
label name
00:42:48
but it is
00:42:50
if it is a label then
00:42:55
it is just good practice to make it
00:42:59
like that
00:43:07
right now labels work with captions if i
00:43:10
am not mistaken yeah
00:43:13
and as you see this one's caption is
00:43:14
already perfect
00:43:16
this one should be surname
00:43:19
and this one should be named
00:43:23
alright so now when you're pressing
00:43:24
afrikaans this should change to
00:43:26
afrikaans when you present english this
00:43:28
should be changed to english
00:43:31
unless it already is which it will not
00:43:33
matter then represent spanish it should
00:43:35
change to spanish
00:43:38
now let's start off with recalls again
00:43:40
now
00:43:41
lbl
00:43:44
name dot
00:43:46
caption
00:43:47
becomes and enough cons the caption or
00:43:52
name in afrikaans is norm
00:43:56
there we go
00:43:59
could i say something
00:44:00
you want to do that okay
00:44:03
so
00:44:04
yeah the lbl surname
00:44:08
dot caption
00:44:11
becomes
00:44:15
fun
00:44:18
and then lblh
00:44:21
dot caption
00:44:24
becomes
00:44:27
odor dom
00:44:29
if i'm not mistaken
00:44:32
can you not
00:44:38
now if you run it it should work and
00:44:41
shouldn't have any problems
00:44:43
so let's select afrikaans
00:44:46
norm fun odor door
00:44:49
yeah i think that's
00:44:52
that works
00:44:56
now we should of course still do the
00:44:58
english because if the changes are
00:45:00
considered like i don't actually
00:45:01
understand it because they do
00:45:03
we should be able to
00:45:07
you know
00:45:09
they should be able to change it back so
00:45:11
i'll be our name
00:45:13
dot
00:45:14
or we can just be lazy and
00:45:16
do this
00:45:22
do you give a name
00:45:26
yeah it just doesn't look right
00:45:28
surname
00:45:32
the age
00:45:33
[Music]
00:45:35
all right
00:45:36
and then we just have spanish
00:45:40
now i don't know any spanish so i'm
00:45:42
going to go
00:45:43
here and
00:45:45
name
00:45:46
nombre
00:45:48
or i just copy that
00:45:52
okay oh wait
00:45:53
we want to do it faster let's
00:45:57
let's do this
00:45:59
let's do this
00:46:01
nothing was
00:46:05
i think
00:46:07
yeah
00:46:08
okay then
00:46:10
surname
00:46:21
all right and let's see if all of the
00:46:23
buttons work
00:46:25
so it is
00:46:28
josh
00:46:31
smith
00:46:33
and he is 19.
00:46:36
now we can reset that yes change it to
00:46:39
afrikaans
00:46:41
english
00:46:42
spanish
00:46:44
it works perfectly right
00:46:47
but you know i once heard from someone
00:46:50
who programmed that
00:46:52
a good programmer is
00:46:54
someone who
00:46:57
does that extra effort
00:46:59
so we're going to go back to reset
00:47:03
and
00:47:04
we are going to just
00:47:06
do this
00:47:08
because the main language everyone knows
00:47:11
or most people knows is english
00:47:13
so if they say clear shouldn't it change
00:47:16
back to english for them
00:47:19
because let's say they're they didn't
00:47:21
actually know they just want to go back
00:47:22
to where they were see let's say they
00:47:24
did that and they don't know like what
00:47:26
okay which one of these was the one i
00:47:28
actually chose because people are
00:47:30
terrible with actually reading in
00:47:32
english you know
00:47:34
so then you just go reset and there
00:47:45
so today we're going to be working on
00:47:47
your basic output
00:47:50
now first off let's start completely
00:47:53
from beginning make a new
00:47:56
v-cell forms application
00:48:02
all right
00:48:04
i just like that and then
00:48:06
file
00:48:08
save all
00:48:20
then we can go frm
00:48:23
out
00:48:24
put
00:48:25
underscore u
00:48:27
we can copy that
00:48:32
then you can go f4 and underscore output
00:48:36
p
00:48:37
okay here we go
00:48:40
so we're going to start with the basics
00:48:44
now we're going to add a
00:48:47
button this button is going to do a lot
00:48:49
of things this one particular button
00:48:52
then we're going to add a label
00:48:55
we're going to add a memo
00:48:57
[Music]
00:48:58
and that should be all for now
00:49:02
oh yeah and probably a good thing to add
00:49:04
would be a
00:49:06
panel as well
00:49:10
all right
00:49:14
okay now let's just name all of these
00:49:15
things
00:49:19
lvl
00:49:21
out
00:49:23
you just call them last
00:49:28
all right now with memo you will see
00:49:31
that
00:49:32
you don't want that you don't want that
00:49:33
in here so what you do is you go to
00:49:35
lines you click on these three
00:49:38
and you just delete
00:49:40
and then say okay and there we
00:49:42
go then there's panel
00:49:46
there we go
00:49:47
pnl
00:49:50
out
00:49:51
and we just
00:49:53
yeah we can we can keep it locked okay
00:49:56
so then we're just going to name the
00:49:57
button to
00:50:00
btn
00:50:03
display
00:50:09
and then we're going to
00:50:13
make the caption
00:50:16
display
00:50:17
now when i click on this button
00:50:19
each one of these will be changing into
00:50:21
something
00:50:23
so let's
00:50:24
start now we can start with label
00:50:29
now when they click on the label they're
00:50:30
going to get a basic output
00:50:33
so [Music]
00:50:35
lbl out
00:50:37
and then
00:50:39
as we all
00:50:40
whoopsie
00:50:42
as we all know by now
00:50:45
the label has a caption
00:50:49
now if we were to say
00:50:51
dot caption
00:50:54
then we can change its caption
00:50:57
now we shall be going
00:51:02
the
00:51:03
answer
00:51:04
to
00:51:05
five times 5
00:51:08
is
00:51:11
all right
00:51:15
okay now we're going to make this the on
00:51:17
35 times 5 is and this is going to be
00:51:19
the answer so then we can go
00:51:23
now this is where you might we'll change
00:51:25
it a little bit now here's the memo
00:51:28
now as you can see we deleted the lines
00:51:32
first line see we deleted this part
00:51:34
right here
00:51:35
we don't have a caption
00:51:37
as you can see here there's no caption
00:51:39
but we do have lines
00:51:41
so we go
00:51:43
mem out
00:51:46
dot
00:51:47
lines
00:51:48
dot add
00:51:51
and then we go
00:51:55
five times five would be 25
00:51:58
now there is a string output
00:52:01
all right
00:52:03
but what if we don't want a string
00:52:05
output since we have a panel we can just
00:52:06
as well put that to use and go
00:52:11
pnl out
00:52:13
dot caption because the panel has a
00:52:15
caption
00:52:17
becomes
00:52:19
and we can go
00:52:21
because we're going to times five for
00:52:22
five so we're going to go
00:52:25
into string
00:52:27
five times five
00:52:32
now if we're going to be running it
00:52:42
now if i say display the answer to 5
00:52:45
here is a string and here is an integer
00:52:49
so those are the basic outputs you can
00:52:51
get but then you also have a
00:52:55
show message
00:53:01
now a show message is a basically a
00:53:03
pop-up box that tells you things now
00:53:06
let's go
00:53:08
on sir
00:53:10
is
00:53:11
[Music]
00:53:13
and then we plus it with an
00:53:16
enter to string
00:53:18
five times five
00:53:30
now display
00:53:31
then the answer is
00:53:33
25
00:53:36
but if we were to
00:53:39
not add
00:53:40
this
00:53:42
and we're just going to say that we
00:53:44
would get an error because
00:53:46
you can't have in string and an integer
00:53:50
it may must both that this can only take
00:53:52
in a string so you have to convert it
00:53:55
from a string from integer to a string
00:53:56
which is into string
00:54:00
the same here i would want to if i would
00:54:02
want to put it here i'd have to say
00:54:04
empty string first
00:54:05
otherwise it won't work
00:54:07
another way if you don't want it to
00:54:09
actually times you can always just
00:54:12
do that
00:54:14
but then you won't get the answer
00:54:16
already put together
00:54:18
so display
00:54:19
the answer is five times five
00:54:23
that's just the equation
00:54:25
so this was basic output guys
00:54:36
so today we're going to be talking about
00:54:39
adding subtracting and stuff like that
00:54:42
so uh
00:54:43
yeah let's get started
00:54:45
so first off
00:54:47
if you watched my previous video you
00:54:49
would have seen quite a few outputs you
00:54:51
can get so we're just going to use a
00:54:53
show message to do everything
00:54:56
so
00:54:57
first off let's begin with
00:55:01
plus
00:55:04
so we're going to be adding stuff
00:55:05
together with plus
00:55:07
so it should be easy
00:55:10
we don't have variables yet so we're not
00:55:12
going to be using that just yet
00:55:14
uh i first want to teach you guys how to
00:55:16
make sums
00:55:18
so let's start by
00:55:21
just
00:55:22
creating a show message
00:55:25
show message
00:55:28
okay and in here we're going to be doing
00:55:30
everything so let's go
00:55:32
in
00:55:33
to
00:55:34
string
00:55:36
and then in here will be passing and
00:55:38
stuff so plus it's easy it is just
00:55:40
something like
00:55:41
five plus six
00:55:43
and
00:55:44
you should get
00:55:47
11
00:55:52
yes 11
00:55:53
all right
00:55:55
that's easy enough remember that's this
00:55:59
and
00:56:09
this and this is not the same
00:56:12
so
00:56:13
this will just
00:56:15
display
00:56:16
five and six
00:56:18
unlike javascript you can't plus them
00:56:21
together if they're strings
00:56:23
same goes for if you're going to make
00:56:25
this
00:56:26
one string
00:56:29
it's just going to be a string it's not
00:56:30
going to be adding or subtracting
00:56:33
anything
00:56:34
so now we have done plus
00:56:36
now let's do
00:56:38
minus minus is pretty easy
00:56:41
just as plus it can be
00:56:43
int to
00:56:45
str
00:56:47
okay and then just like five minus five
00:56:51
that should give you zero
00:56:57
see zero
00:56:58
very easy now this is where it gets a
00:57:00
little teeny bit different
00:57:05
times
00:57:08
now let's times five by five now you
00:57:10
watch my previous video you know times
00:57:12
is a
00:57:13
whatever that is
00:57:16
now
00:57:18
yeah
00:57:19
you could go that but that doesn't work
00:57:21
because x is a letter
00:57:23
we don't want letters we want that um
00:57:26
this is pretty basic it's mostly the
00:57:28
same in every language
00:57:31
not all of them of course for example
00:57:33
brain you can't do that
00:57:35
so
00:57:36
yeah that is times
00:57:40
show message 25
00:57:44
now
00:57:46
then you also get
00:57:47
divide
00:57:52
divide now
00:57:55
let's divide
00:57:57
25 by five that should give you five
00:58:01
right but that's times so
00:58:04
a divide is a slash
00:58:07
that's all it is a forward slash
00:58:10
and then you divide
00:58:12
oh but wait
00:58:14
into string can't be called with this
00:58:17
argument it's probably because it's a
00:58:19
divide
00:58:32
now in a
00:58:33
type of divide where you would use it in
00:58:35
a into string place like this
00:58:37
you would use a div
00:58:41
and
00:58:42
voila
00:58:44
now dev is something a little bit
00:58:46
different so we're going to be working
00:58:48
with the div a little bit later
00:58:51
but if you would want to have used it as
00:58:54
slash
00:58:56
the actual way people use it
00:58:58
it's going to give you an error
00:59:00
but that is because with a slash you get
00:59:04
returned
00:59:05
in real now in real is something that is
00:59:08
like a number dot or comma and not more
00:59:12
numbers
00:59:14
now
00:59:15
also another word for real could be
00:59:16
float or even double if you work with
00:59:18
java
00:59:20
now
00:59:21
to get a float you just go
00:59:23
float
00:59:26
to string
00:59:28
now this will change it from a double or
00:59:32
a real or whatever you want to call it
00:59:33
two string so remember a float is
00:59:36
something like
00:59:37
five
00:59:38
point six seven that's a float
00:59:41
just five is an integer
00:59:43
five point anything like even five point
00:59:45
zero that's not an integer that's a
00:59:48
float
00:59:49
so
00:59:51
now if you go like that
00:59:54
and you go like that you get five yeah
00:59:57
so that is based the basics of
01:00:00
dividing times plus and minus we'll be
01:00:03
using this a lot more in the future
01:00:14
so
01:00:16
today we're going to be practicing the
01:00:18
basic input
01:00:20
i was going to do variables but then i
01:00:22
said
01:00:23
or then i saw that the book was doing it
01:00:25
in chapter 2 which i feel isn't really a
01:00:28
good way of doing it but we're following
01:00:30
the books we'll be doing it in chapter
01:00:31
2.
01:00:33
so what we have here is
01:00:35
three labels two just normal labels with
01:00:38
captions of first name and certainly
01:00:41
they have no actual name as you can see
01:00:44
then an output which is lbl output which
01:00:48
is also a label
01:00:50
then two edits which is edt name and edt
01:00:53
surname with one button called btn
01:00:55
display so what's going to happen is
01:00:58
we are going to
01:01:00
put in enter our name here
01:01:02
insert our surname here
01:01:04
and when we click on this button
01:01:06
this
01:01:07
should be
01:01:10
the name and surname that we inserted
01:01:14
basically being hello
01:01:17
both the name and in the surname because
01:01:19
we want to greet them
01:01:21
so let's open up our button
01:01:24
and let's start so we don't have
01:01:26
variables it is going to be a little
01:01:28
more effort than it has to be but
01:01:31
when they click on the button
01:01:33
lbl
01:01:35
or it's actually a little bit less you
01:01:36
think about it but anyways lb output dot
01:01:39
caption
01:01:40
becomes
01:01:44
now
01:01:45
or let's first make it hello
01:01:49
and then
01:01:50
just remember the space needs to be here
01:01:53
because we want the space between the
01:01:54
hello and the name
01:01:56
plus
01:01:58
and this is where we get our first input
01:02:00
so it was edit name as you
01:02:04
would see as you remember this is called
01:02:09
edt name
01:02:11
so oh my gosh
01:02:12
so we're going to go edt
01:02:15
name
01:02:16
but
01:02:18
wait let's just first keep like that
01:02:20
now if we run it
01:02:24
you see we get an error because
01:02:26
edt name
01:02:28
is not a string
01:02:31
it is an object
01:02:32
because
01:02:33
this these are objects
01:02:36
so we need to get the text inside of
01:02:39
these objects because they return text
01:02:43
so it's edt name dot
01:02:45
text
01:02:47
once you learn some javascript this will
01:02:49
look really easy but it should look easy
01:02:51
for it right now so you get the object
01:02:53
and then you turn the text inside of the
01:02:55
object
01:02:57
so let's run it now
01:03:03
now if you just insert some random
01:03:04
things hello and in the name see it
01:03:07
works perfectly now
01:03:09
let's get the output
01:03:11
of the surname so we're going to create
01:03:14
a space there's a space between the name
01:03:16
and the surname and then go edt
01:03:19
surname dot text
01:03:24
now when we run it
01:03:27
i will
01:03:28
put in let's just go
01:03:31
neon
01:03:37
strike
01:03:38
so hello neon strike
01:03:40
this isn't completely central but i will
01:03:42
be okay
01:03:43
now as you can see
01:03:46
that is the basic
01:03:48
output
01:03:51
that you get
01:03:52
or input educate excuse me
01:04:06
okay so today we'll be looking at the
01:04:09
calendar
01:04:11
now let's just create a new
01:04:13
v sales forms application
01:04:16
let me resize this a little bit
01:04:19
now what we'll need is one
01:04:21
calendar
01:04:22
to get it confused with one calendar
01:04:25
get one calendar
01:04:27
and then
01:04:29
one edit and one button so let's get
01:04:31
that
01:04:37
all right
01:04:38
so here we have a calendar a button
01:04:40
animated
01:04:42
now what we want to do
01:04:45
is
01:04:46
we want
01:04:47
to
01:04:48
put a date in this button
01:04:50
then when they are in this edit
01:04:53
then when you click on this button wait
01:04:55
you guys know what
01:04:57
remove this edit
01:04:59
we want a spin edit
01:05:02
so here we have a spin at it because
01:05:05
this will make the whole process of
01:05:07
making sure it's only integers and stuff
01:05:09
like that a lot easier
01:05:12
um of course it's still easy if you even
01:05:14
if you don't use them specifically but
01:05:16
anyways
01:05:18
so let's just do this
01:05:24
so then let's rename the button
01:05:28
to
01:05:30
set date
01:05:34
and then we give it a name
01:05:37
of
01:05:39
btn
01:05:41
set date
01:05:48
there's no real specific name for
01:05:50
calendars as far as i know
01:05:52
so i'm just going to go
01:05:57
calendar
01:05:59
because there's no reason to not have a
01:06:01
calendar
01:06:04
so
01:06:05
first thing we're going to do so we're
01:06:06
going to
01:06:08
limit this to only two numbers so you
01:06:11
can go here
01:06:12
to maximum value and minimum value and
01:06:15
you can also change that if you want and
01:06:17
max length
01:06:19
so when you go to it will stay too so
01:06:21
we're going to code this in where we
01:06:23
don't want to do that
01:06:26
so
01:06:28
first we go to
01:06:31
events
01:06:32
whoopsie first we get to events
01:06:35
and then we go to
01:06:38
on activate
01:06:40
okay
01:06:43
wait
01:06:44
okay
01:06:46
set date
01:06:48
dot
01:06:51
max length
01:06:53
and then we're going to make it two
01:06:55
because we don't want 10 to put in
01:06:57
something like 100 you know
01:06:59
99 is a for the max then we're going to
01:07:01
go
01:07:02
sedate
01:07:03
dot
01:07:05
nope
01:07:07
sedate dot
01:07:09
max value
01:07:12
and we're going to put that
01:07:14
at
01:07:15
31
01:07:18
and then yet again set date
01:07:21
dot
01:07:22
minimum value
01:07:25
and we're going to
01:07:26
make it
01:07:29
one because we didn't want them to put
01:07:31
in zero because there is no dates such
01:07:33
as zero
01:07:35
okay so then
01:07:36
we can just
01:07:39
save all
01:07:43
so now we have set a minimum value a
01:07:44
maximum value and a max length
01:07:46
easy as power right
01:07:49
so now
01:07:51
we can here go to set date we're gonna
01:07:53
write it up
01:07:56
so now we go to
01:07:58
we should
01:08:00
click on this
01:08:01
and we should put the value
01:08:04
up to one
01:08:08
here as you can see your value we can
01:08:09
make it one we can hard code that in if
01:08:12
you want but we don't want to do that
01:08:13
right now
01:08:14
okay so then we go to
01:08:18
calendar
01:08:21
dot
01:08:22
day
01:08:25
becomes
01:08:26
and then edt
01:08:28
i mean scd
01:08:30
date
01:08:32
dot
01:08:33
value
01:08:34
these are both integers they taken so if
01:08:37
we're going we're going to run this
01:08:40
then we should get a right output so
01:08:43
let's make this
01:08:46
the fifth
01:08:49
you can see it went to five i can all
01:08:51
just click there and do if you want but
01:08:54
this is
01:08:55
best to do
01:08:56
so then we can go
01:08:58
15
01:09:00
sedate 15.
01:09:04
all right
01:09:05
but now we want to be changing the month
01:09:07
and the year
01:09:10
so let's go to the design
01:09:21
but we don't want to get confused so
01:09:23
we're going to be going here and saying
01:09:27
label
01:09:41
month
01:09:43
we can just change the name to
01:09:46
a cd
01:09:47
month
01:09:51
ac
01:09:52
acd
01:09:54
here
01:09:56
now it is actually a good practice to
01:09:58
put them all in a way that you can read
01:10:00
it so acd
01:10:03
day
01:10:05
now we should just go back to the code
01:10:06
and edit it
01:10:11
so now let's do the month
01:10:14
now what we can do
01:10:17
is we can do this we can do exactly this
01:10:22
but
01:10:23
do the month
01:10:25
but we won't be doing that since we want
01:10:27
to try out more things so let to set the
01:10:29
max length to
01:10:31
2
01:10:33
the maximum value
01:10:35
to 12
01:10:37
and the minimum value
01:10:39
to 1 because you can't have a month less
01:10:41
than zero and then we're going to change
01:10:44
the value
01:10:46
to one
01:10:52
see easy enough
01:10:53
then we go to here
01:10:56
we're going to give it a maximum minimum
01:10:58
as well
01:10:59
so max length is four because it
01:11:02
shouldn't have more than four
01:11:06
max value
01:11:07
should be let's say
01:11:10
2050
01:11:15
so they shouldn't be able to go past
01:11:16
that
01:11:18
minimum value should be
01:11:21
1990.
01:11:26
and then the value
01:11:28
we can make that 2 000
01:11:31
but actually it's
01:11:33
1990
01:11:34
should be a good place certain is the
01:11:36
minimum and you can just take it up
01:11:38
if you had a drop down list it should
01:11:40
have been a little bit better but we
01:11:42
don't have that right now
01:11:44
so then
01:11:45
we can just code it
01:11:48
and let's see that all of the
01:11:49
restrictions work
01:11:52
so here can we have more than two
01:11:56
no we can't
01:11:57
more than two no more than four no
01:12:00
okay and if i'm correct you should be
01:12:02
able to go up to 13 yeah you can go up
01:12:04
to the first thing you can even go up to
01:12:05
14 but as soon as you press any of these
01:12:07
it won't accept it
01:12:09
as well
01:12:11
if you click away so you can put
01:12:13
something higher but it will restrict
01:12:14
you to those specific times so 32 isn't
01:12:18
an option
01:12:21
and
01:12:23
3000 is an option either
01:12:26
okay so that's good to note right
01:12:30
so then we can close that
01:12:32
and now we can set
01:12:34
date this should be easy we can actually
01:12:37
just copy this and stuff
01:12:41
yeah so let's copy this it should be of
01:12:43
quite fast control c
01:12:45
b
01:12:46
now calendar
01:12:48
isn't canon day anymore it's calendar
01:12:50
calendar
01:12:52
month
01:12:53
because we want to change the margin acd
01:12:56
month
01:12:58
the value
01:12:59
then here is a cd year
01:13:02
value and calendar.here
01:13:05
pretty easy compared to most languages
01:13:09
we can run it
01:13:10
should be no errors
01:13:12
and then we can change it to however we
01:13:14
want
01:13:15
so we make it
01:13:17
day five
01:13:18
of
01:13:20
month free
01:13:22
in the year
01:13:24
2000
01:13:27
sit date
01:13:28
and there
01:13:31
we can always make it month eight
01:13:34
sedate there you go now we can't see the
01:13:37
month
01:13:39
but there are ones where we can't see
01:13:41
the month and
01:13:43
you can put them on yourself if you go
01:13:45
here to search for cat
01:13:47
lender
01:13:50
then you get money
01:13:51
which does give you a few extra details
01:13:55
but it's small and you can't really
01:13:56
resize it
01:13:58
you know so it's not really the best
01:14:01
option to have that's why i told you
01:14:03
guys to get the normal calendars and you
01:14:05
can resize it even if you can't see the
01:14:08
specific page right now
01:14:16
and hello everybody welcome back to a
01:14:18
new video
01:14:20
okay so today we're going to make a
01:14:23
traffic light with delphi
01:14:26
so
01:14:27
we're going to be basically be changing
01:14:29
up a bunch of
01:14:31
properties of all of these things
01:14:34
when um
01:14:35
web code
01:14:37
so
01:14:38
yeah let's get right into it
01:14:40
so let's create a nice gui for it
01:14:45
because here in the book they give us a
01:14:47
few they give us what we should do so
01:14:50
we're going to be
01:14:51
seeing what we should do
01:14:53
and then we will be continuing so let's
01:14:56
see the buttons height should be 100
01:14:58
that's mostly what i wanted okay so
01:15:01
let's get the height the rest we will do
01:15:02
ourselves
01:15:04
because i know how to do that so
01:15:06
let me explain to you after i've changed
01:15:08
the height
01:15:15
okay now these we want to be as we want
01:15:18
to have as circles
01:15:20
because
01:15:22
the traffic lights use circles and not
01:15:24
squares or at least here they use
01:15:27
circles
01:15:28
so let's first change these to circles
01:15:34
circle
01:15:37
circle
01:15:39
and circle so here we are completely
01:15:41
leaving the book uh we'll just be
01:15:43
completing command like um make sure the
01:15:46
circles turns on and stuff
01:15:48
so first off we want to change this
01:15:50
background of the form we want to make
01:15:52
it black because you know
01:15:54
they are black
01:15:57
there so then we can just
01:16:00
make the color
01:16:02
black
01:16:03
we can actually do that
01:16:06
while
01:16:07
in the code but let's try it or not
01:16:10
because now if we're going to run it
01:16:11
nothing special is going to happen but
01:16:14
it will look more like
01:16:16
in
01:16:17
traffic light
01:16:19
there we go
01:16:22
so you can actually make it like the
01:16:25
green goes on then yellow then red and
01:16:27
you don't have to express the buttons
01:16:28
but we're going to press a button then
01:16:30
this light will come on and stuff like
01:16:32
that
01:16:33
so let's give them all names this will
01:16:35
be
01:16:36
shp red for shape red
01:16:41
then we have the buttons
01:16:43
so first let's change their names before
01:16:46
we change anything else so this one
01:16:48
going to be btn red
01:16:59
so now we can change their caption
01:17:03
button that
01:17:09
and there the design is actually ready
01:17:11
somewhat
01:17:13
so
01:17:14
we want to see these we don't want to
01:17:15
make them black just yet
01:17:18
we want to still be able to see them in
01:17:19
the design so we're going to click on
01:17:21
the form
01:17:22
and go to events and then on activate
01:17:26
we're going to change the color of the
01:17:27
shapes so when the form activates
01:17:31
we want
01:17:33
btn
01:17:35
green
01:17:36
to be the color that we'll be showing
01:17:39
so uh
01:17:41
let's change everything inside the code
01:17:43
here so then go
01:17:50
shp
01:17:54
green
01:17:56
access
01:17:57
okay cool
01:17:59
shp green
01:18:02
dot
01:18:08
wait let me quickly see so it's shp
01:18:10
green f12
01:18:12
and click here what's the color change
01:18:15
dot brush okay so this is a nice way for
01:18:18
if you can't remember you can go look
01:18:19
here you can click on it look at an
01:18:21
object experience research dot brush and
01:18:23
then dot color
01:18:24
this is very useful thing to remember so
01:18:27
i suggest you do remember it so it's dot
01:18:31
dot brush dot color
01:18:35
becomes cl green
01:18:39
now that should be correct
01:18:41
let's see if it works because if it does
01:18:42
work wait let's first save the game
01:18:44
because if we save the game
01:18:47
we know we won't lose anything so let's
01:18:48
go first save
01:18:50
save all
01:18:57
all right so now that we saved
01:18:58
everything let's run it and see if it's
01:19:01
green then we're doing everything
01:19:02
correctly
01:19:03
it's green we're doing it right
01:19:05
so now we can make the wrist black
01:19:07
because we don't want them to be seen
01:19:09
so what we can do is you can type all of
01:19:11
this over but that's going to be
01:19:13
everything let's be lazy and copy it
01:19:16
so there we go shp
01:19:19
yellow
01:19:21
and then red
01:19:23
then go with both of them we can go cl
01:19:27
black
01:19:29
and then here as well we can go cl black
01:19:32
now they shouldn't be seeable
01:19:35
from when we run it
01:19:39
perfect so now you can only see this but
01:19:41
clicking on buttons doesn't do anything
01:19:43
just yet
01:19:44
which is not good because we want
01:19:47
to
01:19:49
them to work correctly
01:19:52
so these are pretty simple stuff
01:19:55
but i'm still going to do it with you
01:19:56
guys
01:19:57
just so you guys can
01:19:59
see
01:20:01
so let's take that away now first we're
01:20:03
going to do green
01:20:06
but green is actually already on so we
01:20:07
want to see if we could actually work so
01:20:09
we're going to go red first
01:20:11
now i'm just going to copy this
01:20:15
and paste it there now
01:20:18
what we can do is we can't really type
01:20:20
it or maybe put in specific parameters
01:20:22
but that's
01:20:23
a lot of effort and you don't really
01:20:25
need to do it so we can just go cl
01:20:28
black
01:20:29
and then here read we can goes cl
01:20:33
red that saves us a lot of time and a
01:20:35
lot of unnecessary coding
01:20:37
so now if you press on red
01:20:41
it works almost perfectly
01:20:46
so let's just quickly
01:20:48
fix the design here because that's
01:20:50
really annoying looking at that the
01:20:51
whole time
01:20:52
there we go ah that's gonna look so much
01:20:54
better you can put us more into the
01:20:56
middle of everything instead of at the
01:20:58
top you know
01:21:00
and then we can bring
01:21:07
then we can bring this up closer and
01:21:09
there we go we have a beautiful traffic
01:21:11
light but we are not done yet so we're
01:21:13
going to go here
01:21:15
we're going to paste it again and we can
01:21:16
even
01:21:17
this is not good practice you first
01:21:19
finish the code you're actually working
01:21:21
with so don't follow this one but they
01:21:23
make an open green as well first finish
01:21:25
your code because otherwise you're going
01:21:26
to get confused and it's not going to be
01:21:28
nice
01:21:29
damn it look at this copy this
01:21:32
let's paste it here so this one is
01:21:33
already actually done so we don't have
01:21:35
to worry about this one and this one on
01:21:38
the other hand is not done
01:21:40
so we can just go cl
01:21:44
black
01:21:46
and then we can go here cl
01:21:49
yellow
01:21:50
now as far as i know this should do
01:21:53
everything that is required
01:21:56
so you have green if you click on it
01:21:57
nothing happens yellow red yellow green
01:22:01
as you can see they all work perfectly
01:22:03
now
01:22:05
and that wasn't too hard now was it it's
01:22:07
very basic code
01:22:08
if you can understand this then i can
01:22:11
guarantee you you'll understand what's
01:22:13
coming on in the next video
01:22:21
so we're finally starting with variables
01:22:24
you guys don't understand how excited i
01:22:27
am about this
01:22:28
oh so then let's click on calculate to
01:22:31
open a on click ok can you open an on
01:22:34
click function please
01:22:36
there all right
01:22:37
so there are three types
01:22:40
now the first two you don't have to
01:22:42
really
01:22:43
do work with just yet these are mostly
01:22:48
you know
01:22:49
for you
01:22:50
to later on okay so first you get
01:22:53
private declarations now i'm not going
01:22:54
to go through the nitty gritty things
01:22:56
i'm just going to tell you guys for now
01:22:59
and what these are what this one is
01:23:01
mostly used for and but i'm not going to
01:23:03
go into the very deep details and tell
01:23:05
guys what specifically you'd use it for
01:23:08
that we can do later on once we get to
01:23:10
the bigger projects
01:23:12
so first off you get private
01:23:14
now to declare a variable
01:23:16
um you get the different types of
01:23:18
variable you get a string
01:23:20
which is a word
01:23:23
wait let's let's put this in a
01:23:25
there so first
01:23:27
you get a
01:23:28
string
01:23:30
which becomes
01:23:32
a word
01:23:34
for example
01:23:37
my name that's
01:23:39
this is a string
01:23:42
um
01:23:43
hello
01:23:45
that's a string a string can also be
01:23:47
something like a sentence for example
01:23:49
how are you
01:23:51
this is a string
01:23:53
they get a character
01:23:57
or a char this is literally just take
01:24:00
a character for example
01:24:02
a or b
01:24:04
or c
01:24:06
you know there
01:24:08
there's not really anything too special
01:24:10
you know
01:24:11
so these are the main types of things
01:24:13
you'd work with
01:24:14
when you talk about strings
01:24:17
so not really that much but you do get
01:24:20
like once in a while you'll find that
01:24:22
now note these are very important almost
01:24:25
all programming languages you'd have
01:24:27
this
01:24:28
you'd have something that is a variable
01:24:30
so
01:24:31
keep this in mind you got to get this
01:24:33
one underhand so then there's also an
01:24:35
integer
01:24:37
now integer is basically a number
01:24:40
for example
01:24:42
five
01:24:43
or
01:24:44
nine or even
01:24:46
seven thousand
01:24:48
all right but do not confuse it with
01:24:52
this
01:24:53
this
01:24:54
is a string because it is in these
01:24:58
quotes
01:25:00
this is a number because it does not
01:25:03
have quotes
01:25:04
so
01:25:05
keep that in mind because selfie will
01:25:06
see this is a string
01:25:09
then you get a real
01:25:13
or a
01:25:15
double
01:25:16
now in java you'd usually use a double
01:25:18
but in delphi you have the option to use
01:25:21
a real
01:25:22
now these are basically also
01:25:25
numbers
01:25:27
but
01:25:28
these numbers can be something like
01:25:30
5.79
01:25:32
or
01:25:33
9.0
01:25:36
or even
01:25:38
8765 point
01:25:44
this is a real or a double
01:25:46
but if you were to put something like
01:25:48
this here it will give you an error
01:25:49
because an integer is only whole numbers
01:25:52
while a double
01:25:54
can beats things like this
01:26:03
let's first do this
01:26:05
so to declare variable you go underneath
01:26:07
procedure
01:26:09
or pro here private but we'll get to
01:26:11
that later there's going to be in public
01:26:13
but that's also for later time pretty
01:26:15
fair to say you're going to start
01:26:16
declaring variables here
01:26:18
now let's go s word
01:26:21
yeah it's word
01:26:23
and then you go
01:26:24
this this basically says becomes or is
01:26:27
you know and you go string
01:26:30
but since delphi isn't really
01:26:33
capital sensitive you can do that or
01:26:36
that it doesn't really matter because if
01:26:38
they press ctrl d
01:26:41
it's not going to give you any problems
01:26:44
okay so now let's just fix that because
01:26:46
that's annoying okay so then we can go
01:26:48
like this now how to declare a variable
01:26:50
you can go like
01:26:52
s word
01:26:53
becomes
01:26:55
and then in these quotation mark things
01:26:58
you can go
01:27:00
and make maybe
01:27:03
hello
01:27:08
now the reason why we say s word
01:27:12
with the s and not just word is because
01:27:14
when we work with this
01:27:16
this basically tells us this is going to
01:27:18
be a string because later on you will be
01:27:20
doing things like
01:27:22
is word
01:27:24
plus into
01:27:26
a string
01:27:28
i
01:27:30
numb
01:27:32
i'm yeah
01:27:34
plus is word
01:27:36
to maybe
01:27:39
and things like that and let's just go
01:27:40
like this
01:27:41
remove that
01:27:43
that
01:27:45
and that
01:27:46
now yes you can still read it but later
01:27:49
on it's nothing it's not going to always
01:27:50
take words it will change to things like
01:27:52
name or even
01:27:54
id number
01:27:56
id num now id number can be a string
01:27:59
guys just like phone number
01:28:02
it's it's you can make it a string it's
01:28:04
not impossible so it's usually good
01:28:07
practice to do that you don't have to
01:28:08
but it's good practice
01:28:10
now
01:28:12
let's go and declare another string to
01:28:15
do that you go copy i mean comma
01:28:18
and
01:28:19
it's word
01:28:21
to
01:28:22
now you can also do this is word
01:28:26
free
01:28:27
sorry about that f3
01:28:29
and go string and do it all one by one
01:28:32
but
01:28:33
delphi made it easy for you just made
01:28:35
you have you set a comma
01:28:40
now we can go yes
01:28:43
word
01:28:44
to
01:28:45
becomes
01:28:47
world
01:28:50
world
01:28:54
so now we can do this because we have an
01:28:57
edit
01:28:58
sorry about that
01:28:59
we have an edit here this is edited edit
01:29:02
out
01:29:03
now once we when you say calculate we're
01:29:05
going to like
01:29:07
display hello and world as one word so
01:29:09
then we go edt out dot text
01:29:13
becomes
01:29:15
an s word
01:29:18
plus and then a space in between
01:29:20
plus s word
01:29:22
two
01:29:23
right now you might not see the point of
01:29:25
all of this
01:29:26
but once we get deeper into this guy
01:29:28
you're really going to love it i'm
01:29:31
telling you this is the variables makes
01:29:33
everything easier
01:29:34
there is a calculate hello world
01:29:37
that's very nice right guys so basically
01:29:40
this just says
01:29:42
um
01:29:44
hello
01:29:45
and then plus a space
01:29:48
plus
01:29:49
world
01:29:51
that's all that basically says
01:29:54
remember you can also put sentences in
01:29:55
here so you could have gone like a
01:29:57
sentence and say hello world and it's
01:29:59
one sentence
01:30:01
so yeah
01:30:02
now let's remove that because it said
01:30:04
calculate now we're going to declare an
01:30:06
integer
01:30:08
so now we're going to go
01:30:11
i num
01:30:12
1
01:30:14
comma i num 2
01:30:17
and we're going to make that integer
01:30:21
now let's also go b
01:30:23
flag
01:30:25
and go
01:30:27
boolean
01:30:31
sorry about that
01:30:32
boolean okay so now we have a boolean as
01:30:34
well
01:30:36
so now we make b flag
01:30:39
equal to or it becomes excuse me
01:30:43
false
01:30:45
for now it's good to see what it should
01:30:47
be at the beginning because you know
01:30:50
so because sometimes it might be true or
01:30:52
false randomly i don't know i might just
01:30:55
do that at the beginning so in goo
01:30:58
i num1
01:31:00
becomes five
01:31:04
item two
01:31:07
becomes
01:31:11
and then let's also teach you something
01:31:12
else let's add math here
01:31:15
math
01:31:17
now math is something that you use to do
01:31:20
math with now in javascript you'd go
01:31:23
math.round
01:31:26
and then insert whatever you want to
01:31:27
round
01:31:29
but in here you put math right on the
01:31:31
top there
01:31:33
and then you go
01:31:34
round so it's kind of like math around
01:31:37
and then you go like let's say 5.89
01:31:42
now round will round this up
01:31:45
or down to the nearest integer for let's
01:31:47
say if it's 5.8 it will go to 6. if it's
01:31:51
5.4 it will go to 4
01:31:56
or it will go to 5 excuse me not four
01:31:59
so
01:32:00
yeah and if it's five point five it will
01:32:01
go to six as well there's already half
01:32:03
way you know
01:32:05
so now we go if
01:32:11
i num
01:32:13
2
01:32:14
is equal
01:32:16
to
01:32:17
it's going to be 6
01:32:20
then begin
01:32:23
and then we go b
01:32:24
flag
01:32:28
b flag becomes true
01:32:31
now this is a basic example we'll get to
01:32:34
more of this later and then we can go
01:32:37
if
01:32:38
b flag
01:32:42
equals
01:32:43
yeah if b flat if it's if you want it to
01:32:45
be true you can just go if b flag but if
01:32:47
you want it to be false you have to say
01:32:49
false
01:32:50
so if it's false but if it's true you
01:32:52
can actually just go b flag or you can
01:32:53
go b flat equals true
01:32:56
you can go begin
01:32:58
just make this a little bit nicer then
01:33:00
you can go
01:33:01
in one
01:33:03
plus
01:33:06
i num too
01:33:11
boy
01:33:12
there you go
01:33:15
edt out
01:33:17
dot text
01:33:19
becomes now
01:33:20
note guys an edit
01:33:23
cannot take in an integer
01:33:26
it is a string holder
01:33:28
especially if it's the text then you
01:33:30
have to go int
01:33:32
to
01:33:33
string
01:33:35
i just have to convert these two
01:33:37
into strings
01:33:40
now the reason why i put all of them in
01:33:42
one entry string is because if you
01:33:43
didn't do that it will basically say
01:33:46
five
01:33:47
plus
01:33:49
six
01:33:50
and then you'll just get
01:33:52
56
01:33:56
but if they're still numbers then you go
01:33:58
basically five
01:34:00
plus six
01:34:02
which will equal to 11.
01:34:05
so that is why you put all both of them
01:34:08
in change string not into string this
01:34:10
one plus into string item two
01:34:13
okay good and then you say else so
01:34:21
so
01:34:22
if
01:34:24
b flag is true it will display that else
01:34:29
out dot text
01:34:31
becomes
01:34:33
error
01:34:36
so let's see if it works
01:34:43
calculate and we get 11. this is because
01:34:45
b flag is true so let's just tidy this
01:34:48
up a bit
01:34:51
very okay
01:34:53
so
01:34:56
if we were to say if i num equals
01:34:59
5
01:35:01
then b-flat equals true so b-flat will
01:35:04
now become false
01:35:06
and it will give us an error
01:35:07
so let's run again
01:35:12
calculate see error
01:35:15
so
01:35:16
this is just the basics of
01:35:18
variables we'll definitely get deeper
01:35:20
into this as we go on because these are
01:35:22
very important you're going to use them
01:35:24
a lot later on
01:35:26
so yeah
01:35:27
now if you declare something here
01:35:30
now let me show you something
01:35:33
if we're going to
01:35:34
let's open it and on forum create
01:35:38
so if i'm going to try and use
01:35:40
let's say i numb
01:35:44
to here
01:35:47
then it's not going to give me anything
01:35:49
so for example let's
01:35:52
show message
01:35:54
i numb
01:35:56
into string
01:35:58
i num 2.
01:36:00
let's run this
01:36:02
but oh we are getting an error
01:36:05
now why is that
01:36:07
this is because i numb is
01:36:10
basically invisible to everything around
01:36:13
it except for this procedure here
01:36:18
because it only lasts
01:36:20
for from begin to end
01:36:23
now this is also very important because
01:36:25
this also works a lot in other
01:36:26
programming languages this includes
01:36:28
javascript java
01:36:30
um python almost it i think python i'm
01:36:33
not sure
01:36:34
it probably does yeah
01:36:36
but these are very important to know so
01:36:39
this is why you have a private section
01:36:42
right there so let's remove inum 2
01:36:46
and declare it here
01:36:48
i num 2
01:36:51
integer
01:36:54
now we have an eye now
01:36:56
so let's declare inaudible
01:37:00
becomes what was item 2
01:37:04
let's just copy this
01:37:10
and then
01:37:12
paste it here
01:37:14
b
01:37:17
now when we run it
01:37:23
we get a six
01:37:25
and then we can press calculate and we
01:37:27
get an error because remember b flag is
01:37:29
false
01:37:31
but if we were to make this one
01:37:34
invisible
01:37:36
and go here to variable
01:37:40
i'm
01:37:41
i num 2
01:37:44
integer
01:37:47
we'd still have a bunch of errors
01:37:48
because we didn't know what this is
01:37:51
so that is why you have a private
01:37:54
declaration place
01:37:56
now the public one you will almost never
01:37:59
use until you start doing projects
01:38:02
so yeah we'll get to this one later you
01:38:04
don't have to worry yourself about this
01:38:05
one just yet
01:38:07
because we're we didn't really we don't
01:38:09
really work with those things just yet
01:38:11
this either
01:38:13
so yeah
01:38:14
that's all there is for the variables
01:38:16
for today guys
01:38:22
if statement in most
01:38:24
programming languages is basically
01:38:27
exactly the same thing
01:38:29
so what we're going to do is we're just
01:38:31
going to take
01:38:33
in
01:38:34
basic example
01:38:37
now what an if statement does is if
01:38:40
something is like something do this
01:38:42
that's basically what you tell this team
01:38:45
let's create another variable called b
01:38:48
flag we'll get more into b flat later
01:38:51
boolean
01:38:52
now
01:38:53
recap boolean is true
01:38:56
slash false
01:38:59
now if you have an if statement
01:39:02
it returns true
01:39:06
yeah if the statement is true
01:39:09
then it will do this
01:39:11
if it is not true it will not do this
01:39:15
all right
01:39:17
but if the statement is false so if it
01:39:20
is false then do this but we'll get more
01:39:22
into how to make something if it's fox
01:39:24
happen
01:39:25
so for now let's do this let's say b
01:39:29
flag
01:39:30
becomes
01:39:33
if 5 is bigger than 8
01:39:36
that's false because 5 is smaller than
01:39:39
eight remember bigger ass sign the this
01:39:43
is a mouth remember if you don't know
01:39:44
what a bigger sign is the big sign is
01:39:46
basically a mouth it eats the biggest
01:39:49
one so if it doesn't show to the biggest
01:39:51
version it means that 5 is bigger as
01:39:55
which is not so it will be false so this
01:39:57
is false
01:39:59
now this is an example
01:40:01
now we can go
01:40:03
b flag
01:40:06
now if it is b flag
01:40:09
show message
01:40:15
hello
01:40:16
well we let's make it actually true okay
01:40:18
so we make it true because eight is
01:40:21
bigger than 5 so you make it
01:40:23
true
01:40:25
now if you run this
01:40:31
and we click on this button
01:40:33
we get
01:40:34
hello now let's make this
01:40:38
false again
01:40:43
false
01:40:44
now we're going to run this
01:40:48
let's also get the code in here like i
01:40:50
said
01:40:52
okay can't move it
01:40:54
all right so now we have b flat now when
01:40:56
i click this button it's going to check
01:40:58
if
01:40:59
b flag is true
01:41:02
now i should have actually started with
01:41:05
something else but okay let's first go
01:41:06
to this now if i'm going to click it
01:41:08
it's not going to
01:41:09
do anything because b flag is false good
01:41:11
practice would be to just go b flag
01:41:14
equals true so if b
01:41:17
true so if b flat is true
01:41:20
then
01:41:21
begin
01:41:22
now this is a way to kind of validate if
01:41:25
it's true or false so you can also go if
01:41:28
b flag is false
01:41:30
which it is right now
01:41:32
because an if statement returns a
01:41:34
boolean
01:41:35
if the if statement returns true
01:41:42
now let's just go if b flag or b tag is
01:41:46
true
01:41:47
all right
01:41:49
so if b flag equals
01:41:52
true
01:41:54
then it should run this code
01:42:00
all right
01:42:02
now we have b flag as true now you
01:42:05
should be getting to this around right
01:42:07
now
01:42:14
v lag b flag equals false
01:42:17
or true
01:42:19
so if b flag is true do this
01:42:24
else
01:42:28
remember remember to always use begin in
01:42:30
because otherwise that will later on get
01:42:32
evers and stuff like that we could later
01:42:33
go to how not to add begin and end but i
01:42:36
highly highly recommend that you do
01:42:39
now
01:42:41
now we have a b flag that if it's true
01:42:44
it should run
01:42:45
this piece of code
01:42:49
else otherwise if it is not true
01:42:52
it should say
01:42:54
show
01:42:55
message
01:42:59
oopsie
01:43:02
bye
01:43:05
so
01:43:07
if
01:43:08
show message hello i mean excuse me if b
01:43:12
flag is true which it is
01:43:14
then
01:43:15
run this piece of code run that
01:43:17
but do not run this thing because
01:43:20
it there it does doesn't have to be an
01:43:21
hours then but if b flag is false so
01:43:24
then it will not run this piece of sorry
01:43:27
they will not run this piece of code
01:43:29
because then it's false it doesn't go
01:43:30
down they will go to else i'm like okay
01:43:32
they got something else since your
01:43:34
message so let's make it
01:43:36
fox so if it's false which it is not
01:43:39
because here it says it's true
01:43:42
it will say show message
01:43:44
hello otherwise we'll say bye but right
01:43:46
now it will say bye because
01:43:49
there we go bye
01:43:51
because
01:43:52
b flag is not false
01:43:55
now i hope you guys are getting to know
01:43:57
this a little bit better
01:43:58
i'm trying to make it as simple as
01:44:00
possible especially if you haven't coded
01:44:02
yet like sorry proof programming this is
01:44:04
your first language
01:44:06
so yes
01:44:08
very
01:44:09
important to know
01:44:14
now let's let's bring strings in here
01:44:16
let's go
01:44:18
is name
01:44:21
equals
01:44:23
netsu
01:44:24
alright
01:44:25
so now if
01:44:29
is name
01:44:30
is equal to
01:44:34
take note there's a small in there
01:44:37
so that's not going to work all right
01:44:41
then
01:44:42
else it will show this now we already
01:44:44
have done this so we're going to skip
01:44:46
that so now we're going to go to
01:44:48
else
01:44:50
if
01:44:51
now else if
01:44:53
is basically
01:44:56
like giving another if statement for
01:44:59
example run this
01:45:02
if this doesn't come back is true
01:45:05
try this thing
01:45:08
if this doesn't come back it's true
01:45:10
give us this
01:45:11
all right now take note you can have as
01:45:14
many else if statements in an if
01:45:16
statement as you want it's literally up
01:45:19
to you you can have a thousand of them
01:45:22
and the code will and the computer will
01:45:24
be like okay that's fine literally all
01:45:26
programming languages
01:45:28
so else if s name
01:45:31
equals
01:45:33
net now does it have a capital in
01:45:36
begin
01:45:38
always
01:45:39
ctrl d
01:45:42
again let's really start using my mouse
01:45:44
okay show
01:45:46
message
01:45:51
your name is
01:45:54
net wait wait your name is and use
01:45:57
proper coding
01:45:58
plus so we don't have to change it later
01:46:00
if we were to add it which wouldn't but
01:46:02
you know just for the sake of it your
01:46:05
name is nexu so now let's run it just to
01:46:08
show you that the
01:46:09
small leader in will isn't the same as
01:46:12
the big learning
01:46:14
their errors
01:46:16
oh sorry about that becomes
01:46:22
all right so let's take note
01:46:24
it's name if it is equal to mid 2 of a
01:46:27
small n
01:46:28
do this else if it is nato for begin do
01:46:31
this else if it is not either of those
01:46:34
two do this
01:46:36
now since this it's the second one it
01:46:38
will run the sigma now it will always go
01:46:41
through the first piece of code
01:46:43
first
01:46:44
it will first see if this is true
01:46:46
never will it begin here never in
01:46:49
any programming language will ever begin
01:46:51
at the second if statement or at the
01:46:53
else statement it will always be begin
01:46:55
from the first
01:46:57
if there is all right
01:47:01
now
01:47:02
there we go your name is netsu
01:47:05
now take note else if is basically just
01:47:09
having an if statement
01:47:11
begin and
01:47:14
then adding another if statement
01:47:18
just the difference is if this if
01:47:21
statement is true and this one is true
01:47:24
they will both run well while in this
01:47:26
one if this one is true it will run this
01:47:31
and it won't run the rest
01:47:34
so that's basically the difference and
01:47:36
it's just proper coding if you use an
01:47:38
alice instead of a bunch of ifs
01:47:41
all right
01:47:43
so now we have covered the basics of if
01:47:47
statements
01:47:52
now we're going to do add now what if
01:47:54
you want to check if two things are true
01:47:57
for example if it's name
01:47:59
is netsu
01:48:01
and
01:48:02
b flag
01:48:05
flag
01:48:06
tag
01:48:08
is equal to false
01:48:12
how would you go about doing this
01:48:13
because they gave an error because
01:48:15
there's nothing i was supposed to work
01:48:19
now basically what you do is you go like
01:48:20
that
01:48:22
you add
01:48:24
your
01:48:25
brackets
01:48:28
now what it will do is it will read if
01:48:30
is name equals netsu
01:48:33
so if the name equals netsu they will go
01:48:35
and say oh and okay we shouldn't
01:48:37
continue and if it's this so if both of
01:48:41
these return true
01:48:43
then it will do this otherwise it will
01:48:46
start going to the next one
01:48:48
so now let's make this a small in
01:48:52
and keep that true because this one will
01:48:54
now not run it will say bye
01:48:56
because
01:48:57
neither is this one here g because his
01:49:00
name yeah his name
01:49:01
is the same but b flag is not the same
01:49:05
so this one won't run the top one will
01:49:07
not run
01:49:08
here his name netsu has a capital in
01:49:12
so this is mitsu and this nature isn't
01:49:14
the same so it will go to buy
01:49:18
now take note else isn't really
01:49:21
necessary you can
01:49:22
anything else if it's just good coding
01:49:25
to having else to make sure if the user
01:49:27
enters something they shouldn't or if an
01:49:29
error happens in some way it should
01:49:32
return something else
01:49:35
all right
01:49:36
now let's make this
01:49:37
false
01:49:39
now it will return the first one because
01:49:41
now it's name
01:49:43
and the b flag are exactly the same
01:49:46
so the first one will be hello
01:49:48
okay
01:49:50
now this is where it gets nice now we're
01:49:54
going to do or now also remember you can
01:49:56
do and
01:49:57
in as many as you want as well
01:50:00
it's up to you
01:50:03
basically you can do whatever you want
01:50:06
okay so now we'll do or
01:50:09
or is the same you add your bray
01:50:11
brackets put an ore in the middle and
01:50:14
add the next view
01:50:16
okay so that's useful now if his name is
01:50:20
netsu of a capital n or b flag is true
01:50:24
so let's let's make it easy for a guy
01:50:25
and b flag equals true
01:50:29
now remember in future i will not be
01:50:31
using equals true in the tutorials this
01:50:33
for now to explain
01:50:35
maybe i will it depends on how i feel
01:50:37
that they
01:50:38
so if b flag is true or netsu its name
01:50:42
is equal to initial capital n
01:50:45
then
01:50:47
give this
01:50:48
which means if this returns false
01:50:53
this will most likely return true then
01:50:56
depending because if i go
01:50:58
yeah it will most likely turn true in
01:51:00
this one so if we go through
01:51:03
this one be like nope
01:51:06
nope it does not this does not return
01:51:08
true
01:51:10
then we'll go to elsa then like ah yes
01:51:12
it's name is not equal to netsu but b
01:51:16
flag is equal to truth and it isn't or
01:51:20
so
01:51:22
we should return your name is netsu
01:51:24
with a another capital n
01:51:27
your name is mitsu
01:51:30
now that's or
01:51:31
now i told you guys about the bigger and
01:51:34
or the not like if not
01:51:38
now basically how this will be useful is
01:51:41
if you just put it around everything so
01:51:44
if his name is not equal to mid the
01:51:47
small n
01:51:50
and b flag is not equal to false
01:51:55
so we go something like
01:51:59
this will return true because it is not
01:52:01
equal to
01:52:03
okay
01:52:07
and b flag
01:52:08
is true so if the b flag is true here
01:52:11
that's what it means because it's not
01:52:14
it will return
01:52:15
this one so let's run it and see if it
01:52:17
works
01:52:19
we should say get hello
01:52:21
yes exactly perfect
01:52:24
and as you see it didn't run the race
01:52:26
because why should it
01:52:28
it has already given us the first output
01:52:33
so anyways
01:52:36
that is mostly the basics it is if it's
01:52:39
not equal to that
01:52:41
if it is equal to that if it is equal to
01:52:44
this and that
01:52:47
or if it is equal to this or that
01:52:51
and then you have your else
01:52:53
okay
01:52:54
but just because the if statement
01:52:57
has an elf doesn't mean it has to have
01:52:59
one
01:53:00
you could that is a very valid if
01:53:03
statement
01:53:04
in fact
01:53:08
that is also a very valid if statement
01:53:14
that is a completely valid if statement
01:53:20
if statements are really easy to grasp
01:53:28
so today we'll be checking out an input
01:53:31
box
01:53:32
because we will be using inputs later on
01:53:34
because this is actually a big part of
01:53:36
the healthy and any developer should
01:53:39
actually know how to like get a
01:53:42
message to display up and ask a question
01:53:45
because in certain times and places you
01:53:47
might want that or like when a user
01:53:49
signs in maybe and you don't want to use
01:53:51
a form and you maybe just want them to
01:53:53
enter the username or if you want them
01:53:55
to search for something you want
01:53:57
an input box
01:53:59
so let's so we have a form
01:54:02
there's a button
01:54:03
and there's a
01:54:06
edit
01:54:07
now these don't do anything yet but when
01:54:09
you click on a button an input box
01:54:11
should pop up asking us what's your name
01:54:15
and then you should display it here
01:54:17
and this will basically be the basics
01:54:20
you know
01:54:22
all right so
01:54:23
we could open up for some reason it
01:54:25
doesn't want to let's just go one click
01:54:28
there we go
01:54:30
now you can open it up and we can start
01:54:35
so
01:54:37
first thing we want to do is you're just
01:54:38
going to go
01:54:40
input box because an input box is
01:54:44
very easy now input box takes three
01:54:46
parameters
01:54:48
and there all three of them are string
01:54:50
so it's one two three i usually just do
01:54:53
that so i remember that it should be
01:54:56
free
01:54:57
now this part on the input box is like
01:55:00
the title
01:55:02
so um let me show you let's go um
01:55:05
name
01:55:07
now when we run it
01:55:12
you know what i actually did something
01:55:14
wrong but anyways see name
01:55:17
that is basically that part of an input
01:55:19
box
01:55:20
let's just disable this
01:55:23
could be annoying
01:55:30
okay so when we click on name
01:55:32
we get an input box that says name
01:55:36
now that's basically what that is for
01:55:38
now usually you don't want to put a lot
01:55:40
of text there just like the basics
01:55:42
um stuff like
01:55:44
what's what's the gist of it you know
01:55:46
and here is what you put in like
01:55:49
what is your name
01:55:54
now when we run this
01:55:57
it's going to ask us what is your name
01:56:01
what is your name it asks
01:56:04
and as you can see you can't actually
01:56:05
click off of it because
01:56:07
you should first insert this
01:56:09
which is a good thing because sometimes
01:56:11
if you want to like click off of it and
01:56:13
you have to insert that like if you make
01:56:15
a game or something then it's quite
01:56:16
problematic
01:56:18
so what is your name
01:56:19
now basically
01:56:22
the third parameter is basically the
01:56:24
input or the like what would be inputted
01:56:27
you know like let's say you want a
01:56:29
default value to be an input unless the
01:56:31
user changes it for like let's say netsu
01:56:34
that's
01:56:35
what i use on most of my games is my
01:56:37
username usually
01:56:39
so i go netsu and now when i click on
01:56:42
this it displays netsu in here first so
01:56:45
parameter one
01:56:47
parameter two and parameter three what
01:56:49
this takes in is basically the third
01:56:52
parameter
01:56:53
but if you have been watching my video
01:56:54
you're going to already catch on
01:56:56
something with what i just did
01:56:59
because
01:57:00
it's going to be a little problematic
01:57:03
if we just want to display this inside
01:57:05
of the edit
01:57:07
so if you watch my previous video on
01:57:10
variables you'd know we probably need
01:57:12
something like a string let's go it's
01:57:15
name
01:57:16
string
01:57:18
now we have a string
01:57:20
so
01:57:21
what we're going to do is we're going to
01:57:22
assign his name to the input box so it's
01:57:26
name
01:57:27
becomes
01:57:28
and then input box
01:57:31
now
01:57:32
basically when it runs it's going to
01:57:34
read this and once it sees input box
01:57:35
it's going to execute any function
01:57:40
basically
01:57:42
executes this is a function we'll later
01:57:44
on we'll get deeper into functions
01:57:46
because you can make your own adalfi
01:57:48
for the most programmed programming
01:57:50
languages you can but basically
01:57:53
a function you can assign like a
01:57:55
variable to a function
01:57:57
and once dalvy sees but hey that's a
01:57:59
function it executes the variable
01:58:02
basically
01:58:04
so
01:58:06
now
01:58:08
we want to display the name inside of
01:58:10
that edit right so now i can go edt
01:58:12
output dot text
01:58:15
becomes
01:58:16
his name
01:58:18
sorry about that his name
01:58:21
so now it's going to read this and once
01:58:23
i've input the name is going to display
01:58:25
it into the edit
01:58:27
for example
01:58:28
let's run it so we want it to display
01:58:30
netsu right
01:58:32
so now if we say okay cancel will just
01:58:34
stop the operation
01:58:36
oh wait no it doesn't okay you'll have
01:58:38
to go to cancel okay so
01:58:40
basically
01:58:41
let's start this one
01:58:50
okay so let's click on name now it's
01:58:52
going to describe me too if i press ok
01:58:54
or cancel um you can code what happens
01:58:57
here
01:58:58
because this returns true and this
01:59:00
returns false but we won't be getting
01:59:02
into that right now we'll be leaving
01:59:05
that for a later session
01:59:07
so now it's going to display knit two if
01:59:08
i press okay as you can see it displays
01:59:11
nature but
01:59:13
it doesn't just display netsuite you can
01:59:14
also put something else like
01:59:17
steve's
01:59:19
teacher
01:59:21
if you say okay you get steve's teacher
01:59:27
but if you play something like 32
01:59:30
you're automatically turned into a
01:59:32
string
01:59:38
today we'll be working with constants
01:59:41
now constants aren't really that
01:59:44
important in delphi especially if you're
01:59:47
doing the alpha in school
01:59:48
then most of the time you'll actually
01:59:50
get the constants and you don't have to
01:59:51
answer them but still it's good to know
01:59:53
how they work how to add them and stuff
01:59:56
like that for in case let's say you
01:59:58
don't
01:59:59
use cons you're not in school but you
02:00:01
still use selfie but you know so let's
02:00:03
add a
02:00:04
button
02:00:06
and an edit
02:00:09
now the plan is within this right now
02:00:11
let's just add a button because the plan
02:00:13
is once you press the button
02:00:17
you the price will or let's add it let's
02:00:20
add an edit that's okay so there's an
02:00:22
edit
02:00:23
sorry about that okay so
02:00:27
let's just resize this to look perfect
02:00:31
selected and just so we don't get
02:00:34
annoyed we can say
02:00:36
[Music]
02:00:38
yeah position
02:00:41
and you can just put it in the center
02:00:42
okay cool
02:00:44
so when you click on the button if you
02:00:46
take this value and add that to it
02:00:50
since that is a constant and never
02:00:52
changes so a constantly something that
02:00:54
never changes if you try and change a
02:00:56
constant you'll get an error unless you
02:00:58
change the constant where it was
02:00:59
declared anyways so let's just rename
02:01:02
this pattern really we have to give them
02:01:04
later let's just rename them to
02:01:07
get that
02:01:09
and then this one you can just emblish
02:01:11
one i'll rename because it just makes
02:01:13
that one easier the button we can just
02:01:14
keep it the same
02:01:16
e edt
02:01:19
price
02:01:21
and then we can just change the text
02:01:25
to
02:01:27
nothing
02:01:29
let's give it about let's give it
02:01:34
the vat of 100 would be
02:01:38
40.
02:01:40
i'm 14. i mean 15 because that is 15.
02:01:43
okay so let's go to get that
02:01:46
now
02:01:47
usually you kind of like put constants
02:01:51
somewhere here
02:01:52
but we will not be doing that
02:01:56
all right yeah we will be doing that
02:01:58
yeah
02:02:00
so under implementation will be putting
02:02:02
constants there that is where you should
02:02:04
be putting constants so how to put a
02:02:07
constant there
02:02:09
first thing you do is you go
02:02:11
which is
02:02:12
oh man
02:02:15
okay cool
02:02:17
now let's just do that it looks nice
02:02:19
okay there
02:02:20
so then we can go
02:02:22
const which will kind of like variable
02:02:26
you know like
02:02:27
var
02:02:28
it's just different because it's a
02:02:30
constant so you can't change it because
02:02:32
you can't make constant vat
02:02:35
equal to
02:02:37
if it's already 14 you can't make it 15
02:02:39
you know okay so let's go
02:02:42
that
02:02:44
make it equal to 0.15
02:02:47
now this might bring a few bouncing
02:02:49
around because like how does that
02:02:50
constant know that that should be a
02:02:53
double or a real
02:02:56
now
02:02:57
constants kind of work this out for you
02:02:59
so you don't have to say it's an integer
02:03:01
you never say it's something else for
02:03:03
example um
02:03:06
uh
02:03:07
name
02:03:09
name when you declare constants try and
02:03:11
keep him you know encapsulators just for
02:03:14
just to make it easier
02:03:18
you know like
02:03:20
because this is how most programming
02:03:21
languages work you just if you declare
02:03:23
constantly you make it full calculator
02:03:25
so you know when it should happen or
02:03:29
when it's a constant and stuff like that
02:03:30
just makes the reading easier and so
02:03:32
that's how you declare a constant um
02:03:34
basically you don't have to go like the
02:03:36
integers and stuff like that you're just
02:03:38
like okay let's leave there then we can
02:03:41
start going to
02:03:44
you make it our price
02:03:48
become our price is in real
02:03:52
so let's add a variable so we had a
02:03:55
variable our price now we're going to
02:03:57
get our price from edt price
02:04:01
and then we're going to get we're going
02:04:03
to get the vat from it and we're going
02:04:06
to display it on a show message
02:04:09
so let's go
02:04:10
our price
02:04:13
becomes
02:04:16
easy price dot text but then we go
02:04:20
put this in
02:04:22
brackets and then we go
02:04:26
string to
02:04:27
float
02:04:29
so now we will get a real
02:04:31
string to float
02:04:34
so now we have our price
02:04:37
now we should probably like get them
02:04:42
yeah let's do that let's get
02:04:45
comma or
02:04:47
that
02:04:48
that's not in
02:04:50
so let's make this fat great
02:04:54
okay
02:04:56
so now we can go
02:04:58
r
02:04:59
that
02:05:01
becomes
02:05:04
a battery rate alright wait let's go
02:05:09
our price times the battery
02:05:12
because if we if 0.15 percent is the is
02:05:16
the bad rate in south africa
02:05:18
so if we
02:05:21
times 100 with 0.15
02:05:26
we will get 15 right
02:05:29
so let's do that then we go
02:05:33
show message
02:05:39
format float
02:05:43
okay so then we can go r 0
02:05:47
0.00
02:05:51
and it will be
02:05:53
our bat
02:05:55
now i'm pretty sure i didn't explain
02:05:56
this my earlier video but for in case
02:05:59
basically what's happening here is i'm
02:06:01
saying show the message format thread
02:06:03
this will format your real to a string
02:06:08
and unlike um floaty string would work you
02:06:11
can like say or i can put a dollar sign
02:06:13
there or something like that and it will
02:06:15
round off to the amount of decibels you
02:06:17
want it to
02:06:18
so let's say you wanted to only show an
02:06:20
integer value or you only want one
02:06:23
decimal after that
02:06:25
that's how it works basically and then
02:06:26
it takes it from this value right here
02:06:29
let's go ctrl d
02:06:32
just make things easier
02:06:34
you can do that
02:06:36
we can do that
02:06:37
we can do that
02:06:40
okay
02:06:41
so now let's run it
02:06:44
there shouldn't be any errors and
02:06:46
then let's show you how that beautiful
02:06:49
orbit works now it's 100 so let's get to
02:06:52
that value and it's 15 rand
02:06:54
perfect
02:06:57
disable this
02:07:08
okay
02:07:09
so
02:07:11
now let's try and change that value
02:07:15
since we know we can't do it you know so
02:07:17
let's
02:07:18
just to show you how it works so
02:07:21
that rate
02:07:23
becomes
02:07:24
10. 10
02:07:25
observation
02:07:27
now let's run and compile this
02:07:31
there's an error
02:07:33
because
02:07:34
left side cannot be assigned to
02:07:38
this one cannot be assigned to a
02:07:40
different number because it's a constant
02:07:42
you can't change a constant once it has
02:07:44
been declared unless you do it here and
02:07:46
maybe like 19 or something like that
02:07:48
okay
02:07:50
that is also why once you do then like
02:07:53
austin complete there you go that's
02:07:54
right it automatically tells you it's
02:07:56
0.15
02:07:58
it's not something to be changed
02:08:02
and yeah that is the basics of constant
02:08:06
noise
02:08:12
so today we're going to talk about
02:08:14
something pretty basic but you have to
02:08:16
know this in order to be good at
02:08:18
programming
02:08:20
because otherwise you're going to get
02:08:22
lost in your whole
02:08:25
thing you're trying to do
02:08:26
so today we'll be talking about the ipo
02:08:30
now ipo stands for input
02:08:34
process
02:08:35
output
02:08:36
now it's pretty self-explanatory but
02:08:40
i'll explain it anyways
02:08:42
so basically what it means is how your
02:08:45
programming works
02:08:46
it gets an input
02:08:48
it processes that input and it gives an
02:08:51
output for that input so here i have a
02:08:53
small example so it takes the input
02:08:56
which will be something like name or
02:08:59
something like that it processed output
02:09:02
which we'll be looking at right now just
02:09:04
give me a few seconds
02:09:05
i didn't give you an output so
02:09:08
let's quickly go here
02:09:13
and let's just add a little text here
02:09:15
before i explain it
02:09:21
okay now we have it so
02:09:25
let me show you so first i'm going to
02:09:27
put my name in here
02:09:30
that's an input then i'm going to
02:09:32
process this input which will this is
02:09:34
the process this is processing the input
02:09:38
but actually this whole thing is a
02:09:39
process
02:09:40
it's a procedure but it processes the
02:09:43
input
02:09:44
so
02:09:45
it takes the input right here
02:09:47
and it puts it in the output you should
02:09:50
be understanding this part by now if you
02:09:51
have been watching the whole tutorial so
02:09:54
there's an output but it's the input but
02:09:55
it takes the input processes it into the
02:09:58
output it says take whatever in the
02:10:00
input and say that plus it is is cool
02:10:04
like nitsu is cool you know
02:10:06
and then displayed here with that
02:10:08
because that's the output
02:10:10
so displayed in the
02:10:12
output so basically the process is just
02:10:15
making it work
02:10:17
so let me show you how it runs
02:10:24
all right so here we have it
02:10:27
so here's the input so let's give an
02:10:29
input of netsu
02:10:32
now we're going to process i forgot to
02:10:34
clear it let's clear it like this okay
02:10:36
so
02:10:37
here's the input
02:10:39
so i'm going to process this input so it
02:10:41
gives me an output of net so it's cool
02:10:44
so input process
02:10:46
output
02:10:48
that's pretty cool isn't it
02:10:51
that's it that's all actually to improve
02:10:53
this output
02:10:59
so basically we need three images
02:11:02
so let's go
02:11:04
image
02:11:06
image
02:11:08
image okay we need
02:11:11
one
02:11:13
label it seems
02:11:16
label
02:11:18
we need
02:11:20
three
02:11:21
panels
02:11:23
one panel
02:11:24
one panel
02:11:26
one panel
02:11:27
and we need two buttons but let's first
02:11:31
save these panels from each other
02:11:34
all right there
02:11:36
and now click on that and then we add
02:11:37
two buttons
02:11:39
button
02:11:41
button
02:11:43
all right now we can just do that
02:11:47
all right so in here we're going to add
02:11:49
three images we will we can just go here
02:11:52
in that image here i'm going to code
02:11:53
images in
02:11:54
rarely ever will we have to do that i
02:11:57
haven't done it even in a test
02:11:59
so yeah we all know how to load an image
02:12:01
we have watched that video all right so
02:12:04
now let's go to my pictures
02:12:13
all right now pretend all of these are
02:12:15
movies
02:12:16
during the franks is actually serious so
02:12:18
we don't have to worry about that
02:12:20
you can go
02:12:21
okay so these three or
02:12:24
all movies
02:12:27
okay
02:12:29
this is the linux the movie
02:12:32
this is the literature club the live
02:12:34
action
02:12:35
and this is darwin in the franks
02:12:39
alright so now we have our movies now
02:12:41
let's edit label to say
02:12:51
looks terrible but it's fine okay so we
02:12:53
can resize these
02:12:55
to be about this size
02:13:00
okay we're going to keep all of these
02:13:02
names so there's going to be
02:13:04
image
02:13:06
linux
02:13:15
darling
02:13:19
now these panels
02:13:22
will be keeping the votes so this is
02:13:24
giving them all names as well
02:13:28
uh name name
02:13:30
name name
02:13:33
there okay
02:13:34
p l
02:13:35
line x
02:13:40
okay so we're getting there guys now
02:13:41
let's just change all the captions to
02:13:43
zero
02:13:48
right there we go
02:13:51
so now that we have this we can maybe
02:13:53
like move a little bit more up
02:13:56
yeah okay i guess that'll work
02:14:02
then there's one button for reset though
02:14:04
that's a bit button excuse me that's my
02:14:06
fault let's add a bit button
02:14:10
that's also the button oh my gosh
02:14:15
because now i have two bit buttons
02:14:19
so this one will be alright this first
02:14:21
good account let's change their car
02:14:23
maybe we're lucky and they will change
02:14:24
the name for us this good
02:14:27
bits
02:14:29
btn
02:14:32
close
02:14:36
okay so that's bit button close
02:14:38
and it's kind shall be closed
02:14:43
let's see the change for us
02:14:45
this one's kind will be reset or retry
02:14:50
but we'll change the caption to reset
02:14:53
name
02:14:55
bit
02:14:56
btn
02:14:58
reset
02:15:01
right in the caption that can be
02:15:05
and reset
02:15:09
all right so now we have the basic
02:15:12
layout so let's save everything
02:15:16
by control shift this so what's going to
02:15:18
happen is once they click on
02:15:20
these they're going to um
02:15:23
their cursor will be
02:15:25
turning their finger and once they click
02:15:27
on it this will increase and basically
02:15:30
everyone can vote the one that they
02:15:32
choose will on the end they play like at
02:15:35
school or something you know i i'm not
02:15:38
sure
02:15:39
how to explain it so yeah
02:15:42
we can maybe just go to cursor here
02:15:46
and make it 10
02:15:48
points point
02:15:51
and
02:15:52
point we don't have to cut that in
02:15:56
then we can run it just to make sure
02:15:58
that everything works fine so far
02:16:02
all right so here we have it endpoint
02:16:04
10.10 point not to click on it these
02:16:07
should change
02:16:08
close works
02:16:12
all right so i don't think we have
02:16:13
talked about reset yet reset you do have
02:16:16
to code unfortunately you can't just say
02:16:18
reset
02:16:19
because unlike close which if you say
02:16:21
close it closes everything automatically
02:16:24
and so yeah we
02:16:25
will have to do this
02:16:27
but we'll get to that
02:16:29
so we're going to code these all of them
02:16:31
individually
02:16:33
we can create our own procedure
02:16:35
but we don't know how to do that yet now
02:16:37
do we so we're going to code them all
02:16:39
individually individually
02:16:42
so then i'm going to go
02:16:45
i
02:16:46
vote
02:16:49
and integer
02:16:52
just make sure that you see it's
02:16:53
variable
02:16:55
okay
02:16:56
so now we have a vote
02:16:58
and then when they on click
02:17:02
he
02:17:05
so there you can go
02:17:07
i vote
02:17:10
becomes
02:17:11
i
02:17:13
vote
02:17:15
plus one
02:17:19
something's kind of telling me this
02:17:22
should be a
02:17:23
public
02:17:25
or a private variable
02:17:30
and then on form activate we should make
02:17:32
it zero because otherwise we might find
02:17:34
a problem so let's do that just to be
02:17:36
safe we create a form activate from
02:17:38
create whichever one you get today i'm
02:17:42
going to go i
02:17:43
vote
02:17:45
which is the first one
02:17:52
we can remove this for now and we can
02:17:54
remove this for now
02:17:57
then here at private we can go
02:18:06
now once they click on linux
02:18:11
i both line ups
02:18:13
will become
02:18:14
i vote
02:18:15
sorry
02:18:17
i both line ups plus one
02:18:21
now
02:18:22
so for what we have is once they
02:18:24
activate the form all of these votes
02:18:26
becomes zero all right that's good we
02:18:29
need that
02:18:30
then once they click on hybrid linux
02:18:32
ipod lineups which is now zero will
02:18:35
become i would line up that zero plus
02:18:37
one then it's one and if you click on it
02:18:40
again it will become one plus one that's
02:18:41
two so
02:18:42
basically if you know some java or
02:18:44
javascript or any other programming
02:18:46
language it's basically i vote
02:18:48
linux plus plus
02:18:52
it's basically that but sadly we can't
02:18:54
do that
02:18:55
we can always however go
02:18:59
inc
02:19:00
i
02:19:02
vote linux
02:19:04
now what inc does it increments
02:19:07
whichever and what is ever inside of
02:19:09
here so basically this whole thing is
02:19:12
equal to this
02:19:15
so we're going to use that to shorten
02:19:17
our code
02:19:18
so ink means basically i with line x
02:19:20
becomes i both linux plus one
02:19:24
all right
02:19:25
let's keep that earlier piece of code
02:19:27
here just as an example
02:19:29
slash okay
02:19:32
and then pnl linux dot caption
02:19:36
becomes
02:19:37
end to string
02:19:40
ivo linux
02:19:42
now let's see if this works
02:19:46
so let's run
02:19:52
okay i click on it it works
02:19:56
all right that's nice
02:19:59
so basically we have our templates for
02:20:02
everything right now
02:20:04
let's read just in that so we can just
02:20:06
click on that
02:20:09
copy this
02:20:12
paste it in there
02:20:14
just change it to i
02:20:16
go to dlc
02:20:18
and make i vote dlc
02:20:22
then we can go in here
02:20:26
we can paste it again
02:20:29
i vote darling
02:20:33
i
02:20:35
vote darling
02:20:38
p l darling
02:20:42
p and l dlc okay if you're going to be
02:20:45
lazy you should just remember to fix
02:20:47
everything otherwise you might have
02:20:48
problems
02:20:49
all right so that is basically
02:20:52
for that part of the code
02:20:54
we have
02:20:56
just around so
02:20:58
during the frank's the movie dlc the
02:21:01
live action and line of the movie
02:21:03
basically everyone can say which one
02:21:05
they want to watch
02:21:06
you all know darling that frank's
02:21:08
actually trash one for zero two so it
02:21:10
gets least works
02:21:12
all right
02:21:14
we have the first part but reset still
02:21:17
doesn't do anything
02:21:19
well
02:21:20
basically
02:21:22
we have already coded reset as well
02:21:29
there is
02:21:32
let's copy that
02:21:37
and then we can just copy that i don't
02:21:40
want to top all this up it's a lot to
02:21:41
talk about
02:21:43
and if you're lazy like me this just
02:21:45
copying it just makes you feel so much
02:21:47
easier
02:21:49
press ctrl d press ctrl is run it
02:21:52
and now it should work because we did
02:21:54
everything we need to
02:21:56
so if you do your code from the very
02:21:58
beginning
02:21:59
correct it makes everything easier later
02:22:02
on
02:22:04
so reset perfect it all start from one
02:22:07
again reset perfect start from one again
02:22:11
easy as that
02:22:19
now i told you guys everything about ifs
02:22:21
and l's and stuff like that in the
02:22:22
previous video right
02:22:24
well you're wrong because i did not
02:22:28
in fact i kind of just scratched the
02:22:31
surface and i kind of forgot really
02:22:33
important expressions
02:22:36
now
02:22:37
so what we're going to do is not equal
02:22:40
to
02:22:41
greater than and or equal to
02:22:44
and gray and smaller than or equal to or
02:22:47
less than or equal to however you want
02:22:49
to call it variable
02:22:51
is name okay we will make another string
02:23:00
let's go a little bit more around the
02:23:01
table or
02:23:04
total let's go our total and we make our
02:23:07
total equal to a
02:23:09
real
02:23:10
or if you like java
02:23:13
double
02:23:14
but i enjoy real
02:23:19
now
02:23:21
basically we're going to make our total
02:23:26
it's going to be let's say
02:23:28
55.8
02:23:31
okay
02:23:33
now if
02:23:35
if
02:23:37
or total
02:23:39
now i'm not going to go through the
02:23:40
whole thing about what if statement how
02:23:42
it works
02:23:43
you guys know that i'm just going to
02:23:44
show you guys the as they call it
02:23:47
rational operators
02:23:49
that i forgot to show you guys because i
02:23:51
showed you equal
02:23:53
big small smaller than
02:23:55
bigger than
02:23:58
all that kind of okay
02:24:00
so if r total
02:24:02
and now i'm going to show you is not
02:24:04
equal to in most programming languages
02:24:07
it will be this but they'll be like
02:24:08
excuse me
02:24:10
am i a joke to you
02:24:12
so
02:24:13
it's going to be not
02:24:14
not equal so basically it's not if it's
02:24:17
not bigger or smaller than
02:24:20
okay
02:24:22
and it is not equal okay you know just
02:24:24
don't put it right if it's not equal
02:24:26
bigger or smaller than
02:24:28
then if it is not basically it's the
02:24:30
same value as not
02:24:32
it is just in form of a
02:24:35
operator
02:24:38
okay so if you like using operator use
02:24:41
the operator i highly recommend it use
02:24:43
the operator but if you don't want to
02:24:46
use the operator it is perfectly fine to
02:24:49
just go if not our total is equal to
02:24:52
whatever okay
02:24:53
so if our total is not equal to 10.9
02:24:58
begin
02:25:03
show message
02:25:08
hello so we have already gone for
02:25:11
everything about how this works and i'll
02:25:12
let you guys should know that by now
02:25:13
especially if you watch my previous
02:25:15
video which was way too long then it had
02:25:17
to be so
02:25:19
if our total is being not bigger and
02:25:21
smaller than or equal to that means if
02:25:23
it is not equal to
02:25:26
10.9
02:25:29
then give us this and our total is equal
02:25:32
to 55.8 is definitely not
02:25:35
10.9
02:25:37
now if you would run this
02:25:41
click the button you will get hello
02:25:44
perfect right
02:25:47
so now you have that
02:25:49
now we can show you smaller than or
02:25:52
equal to so if our total is smaller than
02:25:55
or equal to 10.9
02:25:58
share this message but it is not our
02:26:00
total is not smaller than or equal to
02:26:02
10.9
02:26:03
so
02:26:04
this will not be working
02:26:07
click the button as many times as you
02:26:08
want it's not going to run this code at
02:26:10
all okay we're going to put our title
02:26:13
that all time
02:26:14
but if it is bigger than or equal to
02:26:16
this means if our total is 10.9 or
02:26:19
anywhere bigger than that
02:26:22
give us this output which in fact it is
02:26:25
because it is bigger than 10.9 so
02:26:31
now basically what we're doing here is
02:26:33
we're just saying
02:26:34
if our total is bigger than 10.8
02:26:40
but if we go big or equal to we can go
02:26:43
10.9 because now it takes into
02:26:45
consideration the part it starts with
02:26:48
when it's just bigger than it means if
02:26:51
our total is 10.8
02:26:54
it will not run the code
02:26:57
but if our total is 10.9 it will run the
02:27:00
code
02:27:02
or
02:27:03
now a little it's um
02:27:07
if it is
02:27:09
10.8
02:27:10
okay so if it is bigger than 10.8 give
02:27:14
us this output okay let's just do it and
02:27:16
show you guys how it works now press the
02:27:19
button
02:27:21
sumimasen what
02:27:22
i i thought that's it or maybe there's
02:27:24
something wrong it's because i didn't
02:27:26
add that lost
02:27:28
decibel there so yeah just remember that
02:27:30
because otherwise it 8.0 and basically
02:27:33
everything inside 80
02:27:35
somewhat not to say it is okay so just
02:27:38
remember that
02:27:39
so now if you run it
02:27:44
it will not run the code
02:27:46
but if our total is 8 t is 10.87
02:27:52
which is bigger than 10.86 bigger than
02:27:58
and you run the code
02:28:01
you will get the output i total
02:28:04
in integer
02:28:06
okay
02:28:09
i
02:28:10
totally becomes
02:28:13
900 okay
02:28:15
so if
02:28:18
i total
02:28:20
and let's start over that is bigger than
02:28:22
900 so now it will return false because
02:28:25
our i total is equal to not 900 but not
02:28:28
bigger than so press the button but as
02:28:32
many times you want it will not work but
02:28:34
if i total is bigger
02:28:36
or
02:28:37
equal to
02:28:39
900 which means
02:28:41
it takes this into consideration
02:28:44
it will run the code
02:28:49
okay so just remember reals are kind of
02:28:51
a little bit of a gray area when it
02:28:53
comes to if statements you will really
02:28:55
ever actually need to
02:28:57
compare them like this usually it's more
02:29:00
like two variables you compare which
02:29:01
usually works slightly better in some
02:29:03
cases
02:29:05
so yes
02:29:08
now that's bigger or equal to and not
02:29:11
that's basically what i wanted to show
02:29:13
you guys
02:29:18
so today we're going to continue with
02:29:20
the if statement
02:29:22
and we're going to go to morack if in
02:29:26
now i'm going to type now where it is so
02:29:28
let's create two variables variable
02:29:31
is text
02:29:34
which will be a string
02:29:39
or make it three variables and then i
02:29:43
i num
02:29:44
and
02:29:46
i which will be integers
02:29:52
now
02:29:53
usually
02:29:55
the let's make a num
02:29:57
equal to
02:29:59
five
02:30:01
now usually let's say you don't know
02:30:03
what arnam would be because they entered
02:30:04
it into an edit for example and you
02:30:06
don't know what they're going to enter
02:30:08
so usually you'd go like if
02:30:13
i num
02:30:15
is equal to 1.
02:30:18
or
02:30:21
i know
02:30:22
is equal to two
02:30:25
until you get to like ten nine or ten or
02:30:27
something like that now you don't
02:30:30
actually want to do this because this is
02:30:32
a long and very
02:30:35
um
02:30:37
because it's bad practice especially in
02:30:39
delta and under programming languages
02:30:42
maybe not but in delphi it is
02:30:45
so and i actually hope they actually
02:30:47
some at some point add these into more
02:30:50
programming languages
02:30:52
but i'm going to show right now because
02:30:54
it actually is a is very useful
02:30:58
and you don't see it a lot of
02:30:59
programming language so let's go if i
02:31:03
count i mean i numb
02:31:06
and then in
02:31:08
and
02:31:09
practice now this is basically if this
02:31:11
is in this array which we'll get to
02:31:13
later on
02:31:15
so if i num is from 1
02:31:18
to 9
02:31:21
meaning if the number in item is
02:31:24
1 or 9
02:31:26
or one two three four five six seven
02:31:28
eight
02:31:29
nine
02:31:31
then it will do whatever happened
02:31:33
whatever is here
02:31:36
for example let's make it or let's go
02:31:38
one two
02:31:40
five all right so it is five as you can
02:31:44
see
02:31:46
or let's make even more perfect zero to
02:31:48
five there we go
02:31:50
then it's going to show
02:31:53
show message
02:31:59
found number
02:32:02
all right so if the number
02:32:05
in
02:32:07
bynum
02:32:08
is zero two five is one of those numbers
02:32:11
one zero one two three four or five
02:32:14
then
02:32:15
it will do this
02:32:19
otherwise it will not do this
02:32:24
there's an error
02:32:26
ah sorry but that it becomes there
02:32:29
now let's run it and i'll show you now
02:32:31
because inum is five
02:32:34
it's going to
02:32:35
return cloud number but now look at this
02:32:39
if i numb is six
02:32:42
because it's not in zero to five it's
02:32:44
going to
02:32:46
not do anything
02:32:49
this is because unless we actually
02:32:51
increase this to like a nine
02:32:54
it's not going to actually do anything
02:33:02
so today we're going to be checking out
02:33:04
the checkbox
02:33:06
now
02:33:07
basically what is a check box
02:33:10
a check box is
02:33:13
basically giving you an option to choose
02:33:15
something if you click if you check it
02:33:17
then you're choosing it if you don't
02:33:18
check it then you're not choosing it
02:33:20
not to be confused with your radio
02:33:22
button
02:33:25
because there's too many cases where
02:33:27
these two are getting confused by
02:33:30
now the difference between a radio
02:33:32
button and a check box
02:33:34
is a radio button let's say you have two
02:33:36
radio buttons only one of those buttons
02:33:38
can be checked
02:33:40
with a check box if you have more than
02:33:42
one checkbox
02:33:43
then more than one checkbox can be
02:33:45
checked
02:33:46
but with radio button only one can be
02:33:48
checked but we'll get you more to radio
02:33:50
buttons later
02:33:52
so here i have my checkbox you can get
02:33:54
it here and do two pedals
02:33:56
by
02:33:57
searching for checkbox
02:33:59
before you also do that let's make this
02:34:04
contract
02:34:09
that's a contract
02:34:11
and then the name should be the name for
02:34:14
checkbox would be c
02:34:16
b x or c m b but i go c b x just because
02:34:21
check box just feels better
02:34:24
and then
02:34:26
contract
02:34:29
all right
02:34:30
so now we have everything
02:34:32
not really working but we're getting
02:34:34
there
02:34:35
so let's see here what do we have
02:34:37
we have with button one
02:34:40
which is close you don't have to code
02:34:43
bits and calculate now this is basically
02:34:46
what's going to happen inside panel
02:34:48
first you have the cost per sms in cents
02:34:52
so it says 30 cents
02:34:54
and then you have the number of sms's
02:34:57
let's say they
02:34:58
went ahead and sent 10 smses they would
02:35:01
be 300 cents
02:35:03
on the end of the day
02:35:05
but if they choose and the output will
02:35:08
be here and i'll be allowed it's here
02:35:10
you just can't see it but it's there
02:35:13
but anyways
02:35:17
then
02:35:18
if they click on contract if they check
02:35:20
it then basically
02:35:23
they refers to any sms's are free
02:35:27
really the best math question you can
02:35:29
get but it's in the book
02:35:31
you can get rid of this is just to get
02:35:33
you into intro you might do another
02:35:34
video on this
02:35:37
okay now
02:35:38
let's begin we're going to calculate
02:35:40
when we add a few variables
02:35:49
then i price
02:35:53
becomes edt
02:35:55
cost dot
02:35:56
text but this is an integer so this
02:36:00
isn't going to work very well so it
02:36:02
should be str2 and
02:36:09
now that will give you a integer
02:36:11
now to make it safe so that don't
02:36:14
like add strings into it when they
02:36:17
shouldn't
02:36:19
we can go here
02:36:23
and
02:36:24
there's a check box check box as you can
02:36:26
see
02:36:28
right around here that says numbers only
02:36:32
to set that to choose now they can't put
02:36:34
letters in there that's what we want
02:36:41
all right so now we've set the price
02:36:43
then i'm
02:36:45
sms
02:36:46
becomes edt cost dot text
02:36:53
oh edt cost excuse me
02:36:55
sed numbers i mean it's not value
02:36:58
all right
02:37:00
now let's just give a set value here for
02:37:02
in case they decide to try and um
02:37:05
do something they just click and i'll
02:37:08
actually look at it
02:37:09
it's just
02:37:10
good practice to try and do that you can
02:37:12
also force it to have a decent value
02:37:15
but we're not going to do that so let's
02:37:17
go to text
02:37:20
and in text we just added zero
02:37:23
or let's go for practice and make it
02:37:25
early
02:37:26
30 cents
02:37:28
all right
02:37:31
then calculate
02:37:35
now we can go if
02:37:38
cbx
02:37:40
contract
02:37:41
dot checked
02:37:43
now this sees if the user checked the
02:37:46
contract checkbox and it will return
02:37:50
true if it does so if
02:37:54
if this is checked
02:37:58
then we're going to go
02:38:03
so first we can do we have too many ways
02:38:06
of doing this so
02:38:07
my suggestion is we go buy num sms's and
02:38:10
we minus it by 20
02:38:13
but that might be problematic because
02:38:14
then the price might go into the minus
02:38:18
so
02:38:21
then wait let's go if
02:38:25
i num sms
02:38:27
is
02:38:29
more than 10
02:38:33
begin
02:38:36
so if it's more than 10
02:38:39
then it goes
02:38:41
in sms
02:38:43
minus 10
02:38:44
for i num sms
02:38:46
[Music]
02:38:48
becomes in sms -10
02:38:53
basically it will just minus it else
02:39:02
in sms
02:39:04
becomes
02:39:06
zero
02:39:07
so if it's less than 10 and this is
02:39:10
checked so they have the contract that
02:39:12
my weight is managed by 20 right
02:39:14
oh excuse me so if it's more than 20
02:39:19
then annum
02:39:20
gets minus by 20.
02:39:23
else it just becomes zero because then
02:39:25
they have
02:39:26
nothing to pay because they are in a
02:39:28
contract
02:39:30
all right
02:39:31
then we can go
02:39:33
i price wait
02:39:37
lbl output
02:39:40
dot tx
02:39:42
i mean dot caption
02:39:44
becomes
02:39:45
and then we can just go here
02:39:47
the book says we should say total cost
02:39:50
equals an iran sign all that okay
02:39:53
so maybe we should just add a real here
02:39:56
so our
02:39:57
final
02:39:58
price or total price whatever you want
02:40:03
okay then we can go
02:40:07
our final price becomes
02:40:11
my num sms
02:40:19
did at the times price
02:40:24
so now they will give us the amount
02:40:26
but this isn't really what i want let's
02:40:28
put this in brackets we don't want it to
02:40:30
return that
02:40:32
we want them to divide weight sorry
02:40:36
take that and then divide it by 60
02:40:39
because we want it in rants or in
02:40:42
dollars or whatever you want
02:40:46
so we divided by 60 which will give us
02:40:48
around
02:40:50
so total
02:40:52
price
02:40:54
equals
02:40:56
and then we can actually go format float
02:40:59
because i believe that would be better
02:41:04
format float
02:41:08
and then we have r 0.00
02:41:12
comma and then our final price
02:41:16
now let's just check here and see if we
02:41:18
have everything the way we need
02:41:20
so if it's checked then if the sms is
02:41:23
more than 20 that happens else it
02:41:25
becomes zero
02:41:26
if this happens then the whole thing
02:41:29
just becomes zero
02:41:32
which
02:41:33
might become problematic because you
02:41:35
can't divide
02:41:38
zero can't be divided by 60 because you
02:41:40
can't divide with a zero
02:41:42
so that might become a little bit of a
02:41:45
problem so
02:41:49
we can do this
02:41:54
all right and then here we can go
02:41:56
our final price becomes zero
02:42:01
and then this will be the output
02:42:05
but
02:42:06
the output should be there if you want
02:42:08
to be honest
02:42:10
because this is an if statement we
02:42:12
should probably put something outside of
02:42:14
this if statement should we not

Description:

This is a Delphi programming crash course that will teach you everything you need to know about Delphi as a student in grade 10 and 11, or as someone who just wants to learn the language out of interest. Enjoy! Timestamps: 00:00:00 - Intro 00:00:31 - The Delphi IDE 00:13:29 - Your First Delphi Application 00:33:06 - Comments 00:36:01 - Images 00:37:36 - Changing Attributes 00:47:38 - Basic Output 00:54:30 - Mathematical Operators 01:00:07 - Basic Input 01:03:56 - Setting Calendar Dates 01:14:11 - Coding a Traffic Light 01:22:17 - Variables 01:38:18 - If Statements 01:42:09 - If-Else Statements 01:44:10 - Else-If Statements 01:47:50 - Logical Operators 01:53:25 - Inputbox 01:59:36 - Constant Variables 02:08:09 - Input-Process-Output 02:10:55 - Building a Voting System 02:22:15 - More Logical Operators 02:29:15 - If ... In 02:32:57 - Checkboxes 02:45:34 - Radio Buttons/Groups 02:51:56 - Case Statements 03:03:43 - Case Lists 03:06:48 - For Loops 03:10:04 - Looping Through a String 03:16:40 - While Loop 03:22:35 - Timer 03:38:03 - Using Val 03:43:43 - Reading From a File - Part 1 03:47:36 - Reading From a File - Part 2 04:07:51 - Writing To a File 04:17:19 - Custom Columns 04:24:19 - What is an Array? 04:30:32 - Creating an Array 04:37:11 - Searching an Array 04:46:56 - Constants 04:53:20 - Procedures and Functions 05:14:21 - What is a Database? 05:17:16 - Connecting to a Database 05:27:20 - DBNavigator 05:30:17 - Inserting Data Into a Database 05:39:03 - Editing Data in a Database 05:49:21 - Deleting Data in a Database 05:56:42 - Filtering a Database 06:07:26 - Calculations With Databases 06:12:51 - Sorting a Database 06:15:51 - Searching a Database 06:21:19 - Working with Multiple Forms 06:32:28 - Bubble Sort 06:54:46 - Text to Speech 06:57:46 - Math Functions 07:18:51 - String Manipulation Functions 07:32:36 - String Manipulation Procedures 07:40:49 - Message Boxes 07:49:31 - More Functions & Procedures 08:01:40 - Working with RichEdits 08:17:21 - Outro For more programming videos, feel free to subscribe to my 2nd channel: https://www.youtube.com/channel/UCZkCdex94Hp-3Aa-42kPhHg Python Programming Tutorials: https://www.youtube.com/playlist?list=PLYBJzqz8zpWasL5mTe0t9W2cXrv7rnnsG Japanese Lessons: https://www.youtube.com/playlist?list=PLYBJzqz8zpWYy-iJ0xckeOjCCE2roN9Ww Delphi Programming Tutorials: https://www.youtube.com/playlist?list=PLYBJzqz8zpWbKtfi2EiYTv4TeaWcR1I6k How-to videos: https://www.youtube.com/playlist?list=PLYBJzqz8zpWbp2DxyVGUCqxSZaCwDvU3C Crash Courses: https://www.youtube.com/playlist?list=PLYBJzqz8zpWbmPw2E0ywUEuhw6FEwVR0U Group Chats: Weeb Chat: https://t.me/weeb_haven Programmer Haven: https://t.me/programmer_haven You can contact me on: Email: [email protected] Discord: https://discord.com/invite/NGtD9s6 Kitsu: https://kitsu.io/users/Netsu Twitter: @stevesteacherYT or click here: https://twitter.com/stevesteacherYT?s=09 Any suggestions? Leave it in the comment section or contact me somewhere else! Thank you for watching!

Preparing download options

popular icon
Popular
hd icon
HD video
audio icon
Only sound
total icon
All
* — If the video is playing in a new tab, go to it, then right-click on the video and select "Save video as..."
** — Link intended for online playback in specialized players

Questions about downloading video

mobile menu iconHow can I download "Delphi Programming - Full Beginner Crash Course" video?mobile menu icon

  • http://unidownloader.com/ website is the best way to download a video or a separate audio track if you want to do without installing programs and extensions.

  • The UDL Helper extension is a convenient button that is seamlessly integrated into YouTube, Instagram and OK.ru sites for fast content download.

  • UDL Client program (for Windows) is the most powerful solution that supports more than 900 websites, social networks and video hosting sites, as well as any video quality that is available in the source.

  • UDL Lite is a really convenient way to access a website from your mobile device. With its help, you can easily download videos directly to your smartphone.

mobile menu iconWhich format of "Delphi Programming - Full Beginner Crash Course" video should I choose?mobile menu icon

  • The best quality formats are FullHD (1080p), 2K (1440p), 4K (2160p) and 8K (4320p). The higher the resolution of your screen, the higher the video quality should be. However, there are other factors to consider: download speed, amount of free space, and device performance during playback.

mobile menu iconWhy does my computer freeze when loading a "Delphi Programming - Full Beginner Crash Course" video?mobile menu icon

  • The browser/computer should not freeze completely! If this happens, please report it with a link to the video. Sometimes videos cannot be downloaded directly in a suitable format, so we have added the ability to convert the file to the desired format. In some cases, this process may actively use computer resources.

mobile menu iconHow can I download "Delphi Programming - Full Beginner Crash Course" video to my phone?mobile menu icon

  • You can download a video to your smartphone using the website or the PWA application UDL Lite. It is also possible to send a download link via QR code using the UDL Helper extension.

mobile menu iconHow can I download an audio track (music) to MP3 "Delphi Programming - Full Beginner Crash Course"?mobile menu icon

  • The most convenient way is to use the UDL Client program, which supports converting video to MP3 format. In some cases, MP3 can also be downloaded through the UDL Helper extension.

mobile menu iconHow can I save a frame from a video "Delphi Programming - Full Beginner Crash Course"?mobile menu icon

  • This feature is available in the UDL Helper extension. Make sure that "Show the video snapshot button" is checked in the settings. A camera icon should appear in the lower right corner of the player to the left of the "Settings" icon. When you click on it, the current frame from the video will be saved to your computer in JPEG format.

mobile menu iconWhat's the price of all this stuff?mobile menu icon

  • It costs nothing. Our services are absolutely free for all users. There are no PRO subscriptions, no restrictions on the number or maximum length of downloaded videos.