lookupalltriple(
DATABASE
,
KEYFIELD
,
KEYDATA
,
DATAFIELDONE
,
DATAFIELDTWO
,
DATAFIELDTHREE
,
SEPARATOR
,
SUBSEPARATOR
)

The lookupalltriple( function is similar to the lookupall( function, but it returns three fields from the target database instead of just one.


Parameters

This function has eight parameters:

database – is the database that will be scanned. This database must be currently open. If this parameter is "" then the current database will be scanned. Note: The lookupalltriple( function will scan every record in the database, including records that are not currently selected. If you want to build an array from only selected records, use the arrayselectedbuild( function.

keyfield – is the name of the field that you want to search in. For example if you want to look up all checks written to a certain vendor, this should be the field that contains vendor names. The field must be in the database specified by the first parameter. (Note: For compatibility with older versions of Panorama, you are allowed to quote this parameter, however, quoting is not necessary.)

keydata – is the actual data that you want to search for. For example if you want to look up all checks written to a certain vendor, this should be the actual vendor name. This parameter is often a field in the current database, but it could also be a variable, a constant, or a general expression.

datafieldone – is the name of the first field that you want to retrieve data from. For example if you want to retrieve check numbers, this should be the name of the field that contains check numbers. This must be a field in the database specified by the first parameter. Note: This function can optionally handle multiple data fields, with a separator, see below for further information.

datafieldtwo – the second field to retrieve data from.

datafieldthree – the third field to retrieve data from.

separator – is the main separator character for the text array you are building (see Text Arrays). This separator will be placed between each retrieved record.

subseparator – the secondary separator character. This separator will be placed between datafieldone, datafieldtwo, and datafieldthree.


Description

This function is similar to the lookupall( function, but it returns three fields from the target database instead of just one. This example will lookup all of the CIOs in the My Address Book database, along with their phone numbers.

lookupalltriple("My Address Book","Title","CIO","First","Last","Phone",cr()," ")

Each name will be separated by a carriage return, with a space between the first and last names. The result will look something like this:

Julie Sanford 555-1234
Brian Long 783-4829
Paul Bradford 892-3382
Maureen Herman 893-4837
Eugene Lester 290-8736
Andrew Winter 948-3823

Note: This function is equivalent to:

arraymerge(
  arraymerge(
    lookupall(thedb,keyfield,keyvalue,datafieldone,mainsep),
    lookupall(thedb,keyfield,keyvalue,datafieldtwo,mainsep),mainsep,subsep),
    lookupall(thedb,keyfield,keyvalue,datafieldthree,mainsep),mainsep,subsep)
  )
}

See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.