Now that we can add records, we need a means to scroll through them. This is where the Next and Previous command buttons come into play. To accomplish this, we will create two procedures.
In the address book file, enter the following text at the location defined in our main page for procedures, as defined within the comments after the previous section's procedures.
proc nextRecord {} { global currentRecord global recordCount if {$currentRecord < $recordCount} { # Clear current entries clearRecord incr currentRecord loadRecord } } proc previousRecord {} { global currentRecord global recordCount if {$currentRecord > 1} { # Clear current entries clearRecord set currentRecord [expr $currentRecord - 1] loadRecord } }