Delphi Exercise: Text Files
 

1) Create a program using a RichEdit, two Buttons and an OpenDialog and SaveDialog that can be used to open and save text files. (Use Reset and Rewrite.)
1) Skep ’n program wat ’n RichEdit, twee Buttons en ’n OpenDialog en SaveDialog gebruik om tekslęers oop te maak en te stoor. (Gebruik Reset en Rewrite.)

2) Create a program to test whether a password typed in an Edit box is the same as one saved in a text file. The password should be saved in a text file called “password.dat”.
2) Skep ’n program om te toets of ’n wagwoord wat in ’n Edit-kassie dieselfde is as een wat in ’n tekslęer gestoor is. Stoor die wagwoord in ’n tekslęer “password.dat”.

3) Create a program that uses a Button to change the following properties of a Form – as saved in a text file:
3) Skep ’n program wat ’n Button gebruik om die volgende eienskappe van ’n Form – soos gestoor in ’n tekslęer – te verander:
          Height           200
          Width            200
          Caption         Text File Test

4) Create a program with which names can be entered with an Edit box into a text file. The text file “names.txt” can be created beforehand. Append new names after a Button is pressed. Use another Button to load the names into a ListBox. You should also be able to delete a selected name from the ListBox and save it to the text file again.
4) Skep ’n program waarmee name met ’n Edit-kassie in ’n tekslęer ingelees kan word. Die tekslęer “names.txt” kan vooraf geskep word. Voeg nuwe name by nadat ’n Button gedruk word. Gebruik ’n ander Button om die name in ’n ListBox in te lees. Jy moet ook ’n naam wat geselekteer word kan verwyder van die ListBox en dit dan weer in die tekslęer stoor.

5) Create a program with which you can save amounts in a text file (“amounts.dat”) using an Edit box and Button. With another Button retrieve the amounts (do not display all of them) from the text file and calculate and display only the total and average of the amounts entered.
5) Skep ’n program waarmee bedrae in ’n tekslęer (“amounts.dat”) gestoor kan word met ’n Edit-kassie en Button. Herroep die bedrae uit die tekslęer (moenie al die bedrae vertoon nie) en bereken en vertoon slegs die totaal en gemiddeld van die bedrae wat ingesleutel is.

6) Type the text below into a text file (“numbers.txt”) a load the columns (ended by a #) each in a separate Memo box on the Form.
6) Sleutel die teks hieronder in ’n tekslęer (“numbers.txt”) en laai die kolomme (afgesluit met ’n #) elk in ’n aparte Memo-kassie op die Form.

Jack#Smith#075 143 2764#
Alice#Du Plessis#071 243 0023#
Ada#Lovelace#085 245 7903#
Bill#van Hekke#014 349 2399#
 






Return to Home Page

© JAK Olivier (2009)

Website: http://www.jako.nom.za/
E-mail: olivier@teachitza.com