DELPHI
STUDY NOTES
MathWithMegan
,/ GRADE 11 REVISION
> IT Grade 12 – Delphi
> Chapter 1:
> Programming Fundamentals
> MathWithMegan
Click here for the complete PowerPoint documents:
IT Grade 12 - Delphi
,/ Preface
/ Preface
If the formatting in PowerPoint on your computer looks wrong, please use the pdf version or upgrade t
the Windows 11 version.
You may adapt and change these PowerPoints as you wish and as it suits your school work.
You are also welcome to share with me any adjustments I can add to the document with credit to you.
If there is any work that is not included in the document or if any of the work is incorrect, please email
me.
You may not sell the documents, but you may refer anyone to my website.
Happy learning!
,/ Contents
/ Contents
< click on text to navigate to slides >
< click on text to navigate to slides >
> 1.1) Arrays Text Files
> 1.2) Working with Date and Time
> 1.1) Arrays & Text Files
> 1.3) Procedures and Functions
> 1.2) Working with Date and Time
> 1.4) User Interface Design
> 1.3) Procedures and Functions
> 1.4) User Interface Design
> 1.5) Databases
,/ 0.0
/ Introduction
,/ Introduction
This chapter is all about revisiting what you learned in Grade 11. Think of it as a
quick refresher to jog your memory, not a deep dive. We covered these concepts in
significantly more detail in our Grade 11 presentations
We won’t spend too much time re-explaining what everything is or how it works.
Instead, we’ll use more formal terms and concepts, assuming you’ve got a solid
grasp of the basics from last year.
If you need a more detailed breakdown of these topics, don’t hesitate to check out
the Grade 11 package on our website—it’s all there waiting for you!
,/ 1.1
/ Arrays &
Text Files
,/ Declaring Arrays
Arrays are a special containers that can store lots of values of the same datatype,
called elements.
All elements in an array should be of the same type, just like a basket for apples
holds only apples.
You can keep adding new elements to the array as long as there's room, similar to
adding apples to a basket until it's full.
Each element in the array has a unique number attached to them, called an index,
which shows its position in the array.
An array can be created using the following syntax:
aNames : Array[FirstIndex..LastIndex] of DataType;
,/ Accessing Elements in an Array
FOR-loops are often used to access item in your array.
For example, if the value of each banking transaction is stored in an array, you can
find the total of all transactions as follows:
, / Text Files
To store data from your program permanently, you need to store the data in a file on
your computer.
To work with files, you'll need to follow these five steps:
• Declare a TextFile variable.
• Assign the text file (file name) to the variable
• Specify what you want to do with the file: rewriting (create/override and edit),
resetting (read), or append (only edit) to it.
• Use the file in your program (read or edit).
• Once you're done, make sure to close the file