BBjFileInfo::getKeyName

Description

In BBj 6.0 and higher, this method retrieves the name of a VKEYED key chain.

Syntax

Return Value

Method

string

getKeyName(int keynum)

Parameters

Variable

Description

keynum

Specifies the key number.

Return Value

The name associated with the specified key number.

Remarks

This method throws an !ERROR=13 if the file associated with this BBjFileInfo object is not a VKEYED file, or if there is no name associated with a specified key number.

Example

rem ' Set and get the names of VKEYED key chains

filename$ = "Sample.dat"
erase filename$,err=*next
vkeyed filename$,[1:1:6]+[2:1:3],[3:1:2],0,64
channel = unt
open (channel)filename$
BBjFileInfo! = BBjAPI().getFileSystem().getFileInfo(channel)
BBjFileInfo!.lock()
BBjFileInfo!.setKeyName(0,"OrderNumber")
BBjFileInfo!.setKeyName(1,"Salesperson")
BBjFileInfo!.unlock()
print "KNUM = 0: ",BBjFileInfo!.getKeyName(0)
print "KNUM = 1: ",BBjFileInfo!.getKeyName(1)
end 

See Also

BBjAPI

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.