Lookup allows you to find an element which matches (or is close) an argument you pass to the lookup function. This API will return the index of the value if it has found a match, otherwise it will return 0.
Parameters
- the array object to search in
- index to start the search from (can pass null, which defaults to 1)
- value to search forSearch argument
- Array
- Start index (OR resulting indicators object)
- Resulting indicators (can be null)
- Search type - "LE", "LT". "GE", "GT". Can be null.
...
Code Block | ||
---|---|---|
| ||
pjs.define("iSRCHWD", { type: 'integerpacked decimal', length: 32, decimals: 0 }); pjs.define("SRCHWDarr", { type: 'charpacked decimal', length: 2, 15 }); pjs.define("arr", { typedecimals: 'char'0, length dim: 1520, dim orderby: 10'ASCEND' }); arr[1] = 'Cornwall'12; arr[2] = 'kingston'23; arr[3] = 'London'54; arr[4] = 'Paris'57; arr[5] = 'Scarborough'89; arr[6] = 'York'63; arr[7] = 'Columbus'29; arr[8] = 'Dayton'26; arr[9] = 'centerville'73; arr[10] = 'vasad'50; SRCHWD = 'York'44; i = pjs.lookuplookupLE(SRCHWD, arr, { low: null80, SRCHWDequal: 81 }); if //i = 6 |
...
(flags[80] && !flags[81]) {
//console.log(var1.trim());
} |
RPG Equivalent
%LOOKUP(), LOOKUP