Tuto WINDEV 25
170 Part 4: Full application with data In these different codes: • HReadLast is used to read the last file record according to the key used for the last search. • HReadNext reads the record whose key value is immediately greater than the one of current record. • HReadPrevious reads the record whose key value is immediately less than the one of current record. In any case: • HOut is used to find out whether the data file is empty. • FileToScreen is used to display the record on the screen. Remark The code in the "Next" and "Previous" Button controls contains additional lines of code to: • Check whether a search was already performed in the Customer data file (test of HOut to find out whether the file reading has started). • Read the first or last record if necessary. Indeed, the next or previous record cannot be read if no reading was performed in the data file. ▶ Save the window by clicking among the quick access buttons. Window test ▶ Let’s run a window test: 1. Run the window test ( among the quick access buttons). 2. Click the "Finding customers" tab pane if necessary. 3. Find a customer (perform a generic search on "BEEF" for example). 4. Browse the data file by clicking each one of the browse buttons. 5. Stop the test to go back to the editor.
Made with FlippingBook
RkJQdWJsaXNoZXIy NDQ0OA==