As you might have noticed in the previous section, the syntax for referring to dynamic fields and tables within a temp-table (or dynamic ProDataSet, query, or buffer) is cumbersome. For example, when you want to refer to the CustNum field of the ttCustomer table through a temp-table handle, you must type out this long line of code:
hTT:DEFAULT-BUFFER-HANDLE:BUFFER-FIELD(“CustNum”):BUFFER-VALUE
There is an alternative shorthand syntax that you can use that can makes writing dynamic references to fields and tables easier. You can use this shorthand syntax when the field or table name you are referencing is known at compile time:
container-handle::named-member
Where container-handle is a temp-table, ProDataSet, or buffer handle and named-member is the name of a member of the container. If the container is a temp-table, then the named-member must be a field in the temp-table and the value of that field in the default buffer for the temp-table is returned. If the container is a ProDataSet, then the named-member must be the name of a buffer in the ProDataSet and that buffer’s handle is returned. If the container is a buffer, then the named-member must be a field in the buffer and the value of that field in the buffer is returned.
As an example, if the CustNum field is known at compile time, you can instead type the following code to reference the CustNum field of the ttCustomer table through a temp-table handle:
hTT::CustNum

The shorthand syntax uses a double colon (::) for the delimiter between the two character strings to help avoid confusion with variables, text strings, as well as static references to database tables and fields. The following table describes the rules that determine which type of delimiter to use between two character strings.

Table 1. Rules for delimiter use between character strings

If the left-side character string is ...

If the right-side character string is ...

Use this delimiter

Examples
All of the following:
  • The actual name of a database or table
  • Known at compile time
  • Not a handle
A member of the left-side handle A period (.)
Customer.CustNum
Sports.Customer
Sports.Customer.CustNum
A handle (not the actual name of a database or table) An attribute or method for the left-side handle A colon (:)
hBuff:NUM-FIELDS
hDset:NUM-BUFFERS
hBuff:FIND-FIRST()

A handle to a container object (buffer, table, or ProDataSet)

Not an attribute or method, but is instead a named member of the left-side handle which is known at compile time A double colon (::)
hBuff::CustNum
hDset::Customer
hDSet::Customer::CustNum