More about VARIABLES

Training Questions and Answers

Moderators: yajra1219, Jayem, kitty_webb, Ywsp, joanCruz03, shela

Post Reply
owen
Site Admin
Posts: 656
Joined: Thu Apr 13, 2017 12:14 pm

More about VARIABLES

Post by owen » Fri Oct 05, 2018 6:07 am

Understanding variables is probably the most IMPORTANT think to know when it comes to learning how to program.

Variables contain the memories of stuff.
Well actually the computer's memory, the RAM (random access memory) and the computer's hard drive
are where the memories are actually stored.

Variables are nothing more then a NAME you can refer to in order to access a particular memory.

Think of it like this:

Can you remember a childhood memory?
I remember one.
When I was just a kid, I got a Christmas present. It was MY FIRST COMPUTER, a texas instrument 99/4A.
https://en.wikipedia.org/wiki/Texas_Ins ... s_TI-99/4A
My dad gave it to me when I was 13 yreas old.
I played really fun games that came with it. Of course you could buy more games which my parents purchased for me later on.
I think I had like 15 games in all.

Now I remember another childhood memory when I wrote my first program on this system.
I learned how to program and I created several games.
I think i made like 10 games.

Aside from this memory I have many more childhood memories.
In fact since I'm an old man now I have thousands of memories.

Code: Select all

Dim As String mymemories(1000)
mymemories(1)="My First Computer"
mymemories(2)="I broke my arm riding a bicycle"
mymemories(3)="etc..."

Print mymemories(1)
Print mymemories(2)
Print mymemories(3)

Sleep
End

Code: Select all

Dim As String mymemories(1000)
Dim As Integer i
mymemories(1)="My First Computer"
mymemories(2)="I broke my arm riding a bicycle"
mymemories(3)="etc..."

For i=1 To 3
Print mymemories(i)
Next

Sleep
End

Post Reply