When you use dynamic buffers, there are a few special rules that you need to be aware of:
  • You can define a delete validation expression for a table in the Data Dictionary when you define your database. Although this is not recommended in new applications, if you have done this, the AVM is unable to verify whether the delete expression is true or not when you use a dynamic buffer for the table. It therefore disallows any BUFFER-DELETE operation on the table.
  • It is important that you use the BUFFER-RELEASE method to release a dynamic buffer when you are done using it, especially if you have written to the buffer. This is true of static buffers as well, where you could use the static RELEASE statement. But because there is no inherent record scoping for dynamic buffers, a record release might be postponed indefinitely if you don’t handle it yourself.
  • A dynamic buffer has the same scope as the widget pool in which it was created. This means that the AVM automatically deletes a dynamic buffer object only when it deletes the widget pool. To delete a dynamic buffer yourself, use the DELETE OBJECT statement, as the preceding example shows.
  • If you place the phrase BUFFER name anywhere in a procedure file, where name represents the name of a table, not necessarily the name of a buffer you defined using a DEFINE BUFFER statement, the AVM scopes the name as it would a free reference to the buffer.