Examples: Using keywords

  1. (DEFAULT) -- If the field KeyThought exists, whatever value is in that field is used for the computed field. If the field KeyThought does not exist, the value of Topic is used.
    DEFAULT KeyThought := Topic;
    KeyThought

    This formula is equivalent:

    @If(@IsAvailable(KeyThought); KeyThought; Topic)
  2. (ENVIRONMENT) -- Converts a number to text and saves it as an environment variable.
    ENVIRONMENT OrderNumber := @Text(NewOrderNumber)
  3. 3 (FIELD) -- This formula adds "Inc." to the value of the Company field.
    @If(@Matches(@LowerCase(Company); "*, inc*"); @Return(""); "");
    FIELD Company := Company + ", Inc."; 
  4. (FIELD) -- This formula creates a new field called CompanyName to hold the name of the company plus "Inc." The field does not become visible unless you add it to the form design, but you can access it by naming it in formulas.
    FIELD CompanyName := Company + ", Inc."; 
  5. (FIELD) -- This formula deletes the field CompanyName.
    FIELD CompanyName := @DeleteField; 
  6. (REM) -- This formula contains five lines of comments before the code.
    REM "6/15/95";
    REM "The following formula calculates the date";
    REM "for the DueDate field";
    REM "DueDate is the Date field + thirty days";
    REM;
    @Adjust(Date; 0;0;30;0;0;0)
  7. (REM) -- This formula contains five lines of comments before the code.
    REM {1/15/01};
    REM {The following formula calculates the date};
    REM {for the "DueDate" field};
    REM {"DueDate" is the Date field + thirty days};
    REM;
    @Adjust(Date; 0;0;30;0;0;0)
  8. (SELECT) -- This formula selects all documents in the database.
    SELECT @All
  9. (SELECT) -- This view selection formula selects only documents composed from the Product Specification form or that are response documents.
    SELECT Form="Product Specification" | @IsResponseDoc
  10. (SELECT) -- This example changes the value of the Status field to Closed except for documents whose Categories Field is "Unsigned Contracts."
    SELECT Categories != "Unsigned Contracts";
    FIELD Status := "Closed"