Re: Iterate Index Keys ?
When it takes me more than an hour to find something in here due to broken links, I feel I should share my discoveries...
I have a form with an embedded browse that is difficult to see when the last record in the browse has been reached when the user moves thru the records using a navigation button. So I wanted to add a sound to notify the user he was on the last record so he knows to move to the next parent record.
Here are the 2 methods I found useful:
lrec = browse1.Index_pointer().Find_Last().record
?typeof(lrec)
= "N"
?lrec
= 50
cur_rec = browse1.Table_Get().recno()
?cur_rec
= 13
So I set these up as shared variables, setting the 1st in the OnFetch event of the form, and the 2nd in the OnRowChange event in the browse - where I test if they match and if so, do a ui_beep().
Now when the user fetches a new parent record the first function gets the new last record number for the browse. Then regardless of how the browse is navigated (using a button or not), when the last record in the browse is reached the two variables will match and the system will now beep!
btw searching the Wiki for 'find_last' does produce a couple of links for index or query - but the scripts are more complex than this was - Which I found searching the browse1 methods for the form in the IW.
When it takes me more than an hour to find something in here due to broken links, I feel I should share my discoveries...
I have a form with an embedded browse that is difficult to see when the last record in the browse has been reached when the user moves thru the records using a navigation button. So I wanted to add a sound to notify the user he was on the last record so he knows to move to the next parent record.
Here are the 2 methods I found useful:
lrec = browse1.Index_pointer().Find_Last().record
?typeof(lrec)
= "N"
?lrec
= 50
cur_rec = browse1.Table_Get().recno()
?cur_rec
= 13
So I set these up as shared variables, setting the 1st in the OnFetch event of the form, and the 2nd in the OnRowChange event in the browse - where I test if they match and if so, do a ui_beep().
Now when the user fetches a new parent record the first function gets the new last record number for the browse. Then regardless of how the browse is navigated (using a button or not), when the last record in the browse is reached the two variables will match and the system will now beep!
btw searching the Wiki for 'find_last' does produce a couple of links for index or query - but the scripts are more complex than this was - Which I found searching the browse1 methods for the form in the IW.
Comment