TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)
Chapter 11 505
B-Tree Indices
External Commands and Utilities Affected
{*REAL* dbf_arg1_data is variable sized}
{*REAL* dbf_arg2_data is variable sized}
spare_area : packed array [1..256] of {8 @ x}
char;
{if present, arg2 data starts at record + 8 + arg1_bytes}
end; {8 + 256 + 256}
Examples of Structured Argument
Three examples of using the structured argument type are given below.
Example 1
X4 field, looking for <= "JOHN", using SPL:
move arg' := ("<=", 0, 4, 0, "JOHN");
Example 2
X4 field, looking for keys >= JOHN, <= STAN, using Pascal:
type
structured_argument_type = crunched record
search_type : pac2; {bytes 0, 1}
version : shortint; {bytes 2, 3}
arg1_bytes : shortint; {bytes 4, 5}
arg2_bytes : shortint; {bytes 6, 7}
arg1 : pac4;
arg2 : pac4;
end;
var
arg : structured_argument_type;
fast_fill (addr (arg), 0, sizeof (arg)); {optional}
arg.search_type := '[]'; {in-range search}
arg.arg1_bytes := sizeof (arg.arg1);
arg.arg1 := 'JOHN';
arg.arg2_bytes := sizeof (arg.arg2);
arg.arg2 := 'STAN';
mode4 := 4;
item := 'FIRSTNAME;';
dbfind (base, set, mode4, status, item, arg);
Example 3
X20 field, looking for keys that start with "SMITH", using C:
char
arg [29]; /* 2 + 2 + 2 + 2 + 20 + 1 trailing null */
arg [0] = '@'; /* want a wildcard search */
arg [1] = '@'; /* use an @ as a wildcard character */