/* LIST and DISPLAY via PP rules — alias-qualified field references. */ PROCEDURE Main() LOCAL aStruct FErase( "people.dbf" ) aStruct := { ; { "ID", "N", 4, 0 }, ; { "NAME", "C", 10, 0 }, ; { "AGE", "N", 3, 0 } } dbCreate( "people.dbf", aStruct ) USE people.dbf NEW EXCLUSIVE ALIAS p dbAppend() ; FieldPut(1,1) ; FieldPut(2,"Alice") ; FieldPut(3,18) dbAppend() ; FieldPut(1,2) ; FieldPut(2,"Bob") ; FieldPut(3,25) dbAppend() ; FieldPut(1,3) ; FieldPut(2,"Carol") ; FieldPut(3,30) dbCommit() ? "--- 1. LIST (all rows, all fields) ---" dbGoTop() LIST ? "" ? "--- 2. LIST p->id, p->name (selected) ---" dbGoTop() LIST p->id, p->name ? "" ? "--- 3. LIST p->id, p->name FOR p->age >= 25 ---" dbGoTop() LIST p->id, p->name FOR p->age >= 25 ? "" ? "--- 4. LIST p->id, p->name OFF ---" dbGoTop() LIST p->id, p->name OFF ? "" ? "--- 5. DISPLAY (current record only) ---" dbGoto(2) DISPLAY ? "" ? "--- 6. DISPLAY ALL ---" dbGoTop() DISPLAY ALL ? "" dbCloseArea() FErase( "people.dbf" ) ? "DONE" RETURN