The following program opens two tables that both have a field named City and creates both private and local variables named City:

use CUSTOMER // Open in current work area

use CUSTOMER // Open in current work area

use VENDOR2 in select( ) alias VENDOR // Open in another work area with alias

private city // Names are not case-sensitive

city = "Peoria" // Alias not required because assignment does not assign to fields

? "No alias:", city // Field from current table

exerciseAliasOp( )

use in VENDOR // Close tables

use

function exerciseAliasOp( )

   local city 

   city = "Louisville" 

   ? "Local defined, no alias:", city // Local variable 

   ? "M alias:", m->city // Private variable hidden by local 

   ? "Customer:", customer->city // Field from table 

   ? "Vendor:", vendor->city // Field from other table