BBjFileInfo::getKeyNumber

Description

In BBj 6.0 and higher, this method gets the number of a named VKEYED key chain.

Syntax

Return Value

Method

int

getKeyNumber(string keyname)

Parameters

Variable

Description

keyname

Specifies the key name.

Return Value

The key number associated with the specified key name.

Remarks

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

Example

rem ' Get the key number of a named VKEYED key chain

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!.setKeyName(0,"OrderNumber")
BBjFileInfo!.setKeyName(1,"Salesperson")
print "OrderNumber =",BBjFileInfo!.getKeyNumber("OrderNumber")
print "Salesperson =",BBjFileInfo!.getKeyNumber("Salesperson")
end

See Also

BBjAPI

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