SYNTAX OF XBASE EXPRESSIONS

The xBase expressions consist of following components:

  1. Constants. There exist numeric constants (1, 2, 0, -5, 7.3 etc.), character constants (symbol strings enclosed in quotes: "Hello!", 'H', " " etc.) and logical constants (only two of them: .T. and .F.).

    [NOTE. Single or double quotes usually have no effect on the evaluation of xBase expression. In Star4Win, however, there is an important distinction: if you edit a database file with variable length fields, specifying an expression with single quotes while LOCATing will result in a quicker (but less accurate) search. Use single quotes in Locate expressions (e.g.: 'something' $ somefield) if you want the search to be conducted quicker, but be aware that some information may never be found (especially if you use complex function syntax in your request). Use double quotes (e.g.: "something" $ somefield if you do not want to miss anything.]

  2. Memory variables. These are denoted as character strings without quotes, e.g. A, b, GREETING, chaR etc. (the letter case has no relevance for memory variables: GREETING is the same as GReEtIng). Only standard Roman characters and the _ sign can be used in memory variable names.

  3. Function names. A function is noted like a memory variable (without quotes), but must include round brackets: Time(), Chr(221), Sqrt(343), SubStr(Trim("Hello! ", 2, 4)) etc. A function is in fact a symbolic conversion of a standard procedure (which may be very long in a real programming language). The expression in brackets itself may be any valid dBASE expression and is called the function argument.

    A function must return a value for its argument, and this value itself becomes a constant, e.g. Sqrt(4) = 2 (Sqrt() returns the square root). A function may also have several arguments (in which case they are separated by commas within the round brackets) or none - e.g. the function Time() which returns the current time without any arguments specified.

  4. Operators. There exist several kinds of operator signs:

See also: ?, STANDARD FUNCTIONS, STARLING FUNCTIONS.