The first statement already looks pretty strange:
{&OPEN-QUERY-CustQuery}

What is that all about? A name enclosed in braces and preceded by an ampersand tells you this is an ABL preprocessor value. You are probably familiar with preprocessor values from other languages you have used. It is nothing more than a substitution string. It is defined up near the beginning of the procedure file, and everywhere it occurs in the ABL code, the ABL syntax analyzer replaces it with the string it has been defined to represent. That way, you (or the AppBuilder) can define a commonly used string of code once and use it multiple times in your procedure.

The AppBuilder generates the definition of this preprocessor value. Normally you do not need to look at it, so it is in a special section that is not displayed along with the rest of your code sections.

To look at the preprocessor definition:

  1. Return to the AppBuilder main window and press F5 or select Compile > Code Preview from the menu. The Code Preview dialog box appears and shows all the code for the whole procedure.
  2. Scroll down in this dialog box to the section marked Preprocessor Definitions to find the definition of OPEN-QUERY-CustQuery, as shown.

&Scoped-define means that this definition is scoped to just this procedure file, rather than being available to any other source files that are associated with this one. From this line you see that the preprocessor OPEN-QUERY-CustQuery is defined to represent the text OPEN QUERY CustQuery FOR EACH Customer WHERE Customer.State = "NH" SHARE-LOCK. In later chapters you explore the differences between defining and opening a query on a table and just retrieving the data using a FOR EACH statement by itself. For now it is enough to understand that the query named CustQuery defines the set of data to be retrieved, the OPEN QUERY statement starts the retrieval, and then other statements that you see next actually walk through the data row by row. The query definition itself is in another part of the AppBuilder-generated code, and just says DEFINE QUERY CustQuery FOR Customer.