Hi.
So in the previous example, we talked about how you actually create the reset procedure.
Now let's learn how to create the reset procedure step by step.
I'm going to show you the skeleton of the procedure so that you can actually duplicate the steps and
carry on yourself.
OK, so let's start the procedure with creating the procedure.
So from the built in blocks.
Move to procedure, click on procedure to pick to procedure, do.
Bring it out here now you can add a name, I say reset one.
The next step is you need to bring the variables as a set so what you can try to do is for the turns,
if you hover your mouse on turns, you will see two such options coming up in the problem.
I need to use the set.
So click on set and drag it and fix it inside.
Next you need.
Mac zero and stick it to the variable, initialize it, I hope we have learned this and in the interest
of your time, you can actually do for the rest of the two variables as you see here.
The next piece, which is important I'm going to show you is how actually you create.
The Initialise local agreed to so I go to variables.
And say initialise local, the name of the variable to and in.
And I pick this and.
Stick it in the initialize local name, and instead of that, I say button one.
Now comes the latter part of is what I'm going to initialize it to, I need to make a list of buttons.
So under the builtin, I go to list.
From list I select, make a list, which should come as a second one.
Click and drag and.
Stick it to the radio.
Next, in order to make the list, I need the buttons now to get the button as an object, I need to
click on every button, scroll down to the extreme end, and you will find the button here as an object.
I pick this and stick it in there.
Likely you will have to add multiple buttons here.
So I do the same for a button to.
Now, in order to get more, you need to click on the will of the list and.
Add more items into it, just click and drag so you will get more items into the list.
So I got one more I try again.
Click on.
The will you will get a prompt click item and put it back if you don't need one.
You can just click and throw it away.
It goes away.
Click and just put it inside, it goes away.
Done.
Next comes is the for each list now in order to access the Falu, you would have to go into the controls
and then find the exact one that matches you.
Which is.
For each item in list, I do.
OK, now I would say for each.
I would really love this to grade one.
And therefore, each would go for the buttons.
So for each buttons in the list that you have in the grid, in order to get the list, I will have to
hover the mouse on grid variable, click the grid variable and stick it into the list.
This would give me access to the list of buttons.
Next, I can actually access the common properties of each and every button in order to access common
properties.
You need to be in the blocks.
Panel after builtin.
You will have your screen.
Then comes your table arrangement and the buttons, everything.
If you scroll to the extreme end, you may have to expand the components and then you would find you
have any button, any label, any notifier.
So these are common properties for all of the button objects.
If you click on any button, you would find the common properties across all the button objects.
And what I'm going to do is I am going to use a text.
So let's find out the set button text scrolling keeps scrolling, keeps scrolling and you find set button
text of the component to add value.
Now let's understand how to use it.
Let me stick it here first.
OK, now set button text now button text of which button the button, text of the button that is determined
by the Falu, I have the buttons in a list.
I am using those buttons with the local variable grade, which will only work within this loop and within
this procedure.
Now, if I hover my mouse, I get the buttons.
So I need one of the buttons that will be determined by the for loop.
And then you need to set.
What are you actually going to add here?
I right.
Click on the block here duplicated and then stick it in.
OK, now it say that my function, it is ready, so I have done it for the text property, I am going
to leave you to get the height.
The width and the font size created in this particular procedure.
It would be very similar, go to any level if you need to hide, find a set button hide and set button.
So the button with this here.
And the button height is here and then in the same way, put the buttons, put the property correctly.
OK, let me show you one more on the height.
So in order to get the height done, I would need the same.
The get buttons.
Go to Bartons, click at buttons, stick it in there now the button is a number, and in order to add
the number, I cannot use the string over here.
So let me go to the numbers here.
So I need to go to math and then pick the number value.
So in order to store a number variable, I need to use a number from math and then bring it here, stick
it to the value and you need to change the value to 60.
So now you know that for the button text, you need to use a string.
And for the height, you need to use a number for the width, you need to use a number.
And for the form size again, you need to use a number.
I hope once you actually complete the reset function, the reset function, I'm going to delete this
first.
The reset function would exactly look similar to what I have on my screen, and then you can test the
reset function as well after we actually create some more details to actually call.
Right now, the reset function is actually created, but you are not calling the reset function.
So let us learn real quick how you call the reset function.
In order to call the reset function, you need to say where exactly this will get created.
I use the screen and on the screen I need to use the initialize function like exactly when it loads.
I need to actually run the function.
And then when I click on procedures, I see I already have the reset function, so I click and drag
and stick it in there.
Dysfunction has already been called, so I would still get an error because I already have it here.
Now what every button for I, I need to have a reset button to actually clear it up and then start from
the beginning.
I already have a reset button below, which I need to use to call the function again.
So let's go back I'm going to use a reset button here so you will find the reset button.
Button and reset click and when you actually click the reset button, you need to call the procedure.
So go to Presidio's again, pick the procedure and stick it in there.
You will find the error because I already have my program written.
So the moment I remove this, which is a duplicate one.
You would see that the program does not have any errors and the same way I am removing this.
Delete the two blocks now, as you see that my program is now capable of initializing it.
To reset my program is also capable of resetting anything that it started with in the next election.
We will learn how exactly we start the game to play the X and O's.
I hope you like this here.
What we have learned is actually to create the reset procedure from scratch.
We learned how to put the procedure in place.
We learned how to put the initialise local variable, how to make a list of buttons and then add a for
each list to actually scan through the list of great variable.
And then from each button we change our set, the property of that button, identifying the button as
one of the variable components to carry on.
This is a supercold that actually can be used to change or reset properties of multiple similar objects
as you see here on the screen, or else I would end up writing nine separate procedures for each button.
Hope you like this session.