(Visual Basic) Demo of an "Array of Records"

v1.8.3 Refining the search - case insensitive, return multiple occurrences


This is a Visual Basic project to demonstrate the syllabus 9.2.2 teachings of "Arrays of records" and "Linear Search". 

 

Links to exe files in the "Releases" section of the GitHub host:

Version

and

link

Changes

1.5.0

v1.5.0 - Four hard coded records, then the entry of further records checks the code for the "Array of Records"

1.6.0

2 additional fields are added and the tab order is checked.

1.6.1

The label for "Paid" was changing to false rather than the checkbox! Now fixed.

1.7.0

Form re-organised so that the tab order makes sense. 1st attempt at validation on gender.

1.7.1

Gender validation had an error

1.7.4

There are still bugs in this validation - can you find them??

1.7.5

Validation on "Submit" started

1.7.6

Validation on exit of each field as well as on submit. A date picker for DoB with default of 1/1/2003

1.7.7

Minor corrections to format - validation now on field exit and on submit

1.8.1

Find working, but 3 errors in the search algorithm:

  • First record never found
  • Search is CASE sensitive
  • Only the first of multiple records found

1.8.2

Infinite loop version - this is what DEVELOPERS DO NOT DO!

  • Changed increment code for "Find" from:
  • searchCount = searchCount  + 1  to
  • searchCount = searchCount

1.8.3

Added 8 extra test records.

Learning to use the list box:

  • Added text boxes to view list box elements clicked and the index of the element
  • Added a module triggered by the "IndexChanged" action of the listBox
  • view data using:   lstStud.SelectedItem
  • view index using:  lstStud.SelectedIndex
  • set focus on a line in the listBox with: lstStud.SelectedIndex = searchCount
  • clear the highlighted rows with: stStud.ClearSelected()
  • Used List box info from: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.listbox.selecteditem?view=netcore-3.1
  • Changed increment code from:

Changed variable: "foundName" to "foundStud"

Made top form label bold & 12 point

 

In Chrome on PC, when you download a release above, click "Keep" as shown below:

Image of an arrow pointing to the 'Keep' option

 

If you see this message, click "More Info":

Image of 'Windows protected your PC' dialog box. Use the 'More info' option

 

And then "Run anyway":

Image of 'Windows protected your PC' dialog box. Use the 'Run anyway' option

 

A video showing the steps to make commits is here:

https://youtu.be/YGv8Li3tQfo

The video demonstrates GitHub's ability to compare code between releases and shows that pushing, pulling and loading releases can be done without any command line code. apologies for the fact that the cursor is showing not showing in the correct position. For those who want to go straight to the relevant part, here are the timings:

0:00 Overview of GitHub commits

0:50 Releases and comparison of v1.6.0 to 1.6.1

5:00 View the v1.7.0 code with gender validation

6:50 Trying the various combinations of m f M and F, only the F works

8:40 Repair of code

9:00 Team explorer finds the changes

9:20 Commit comment

9:50 Commit

10:30 View latest commit in repository

11:50 Change version # on form (I forgot to tab out of the cell)

12:15 HTML text change

12:55 Push the latest changes to GitHub

13:55 View latest commit in GitHub

14:35 Create another release

16:20 Drag new exe to the publish box

16:45 Run exe from the latest release

17:50 Comparison between v1.7.0 and v1.7.1

18:15 View the latest change to the HTML "index" file

18:35 Finish