Records
You may find that sometimes there are a lot of variables that are related to each other in some way. For instance you might find that you have a door and know its height, width etc. and want to keep them all together.

This sounds like a job for : records

Records are just a way of defining your own type. It is done like this:

Now when you want to use doorType in your program you would do this:

It's that easy! You may notice I have used the with statement. What this means is that you don't have to prefix each of the fields with the variable. So you can see that it can save you quite a bit of work.

So here's my sample program for finding the area of a door.


Previous Lesson (Arrays)     Main Menu     Next Lesson (Objects)