Page History
...
Code Block |
---|
/* This code fragment counts the number of bytes in the CUSTOMERS table. The result is stored in data_bytes at the end of the loop. ReadO is used because record locking is unnecessary, since the only purpose of reading each row is to determine its length. */ Open "CUSTOMERS" To customers_file Then data_bytes = 0 Select customers_file Done = 0 Loop ReadNext @id Else Done = 1 Until Done do ReadO @record From customers_file, @id Then data_bytes += len(@record) + len(@id) End Repeat /* data_bytes contains the number of data bytes in the table. */ End |