BBjKeySegment::getOffset

Description

In BBj 6.0 and higher, this method returns the zero-based offset of a BBjKeySegment object.

Syntax

Return Value

Method

int

getOffset()

Parameters

None.

Return Value

Returns the zero-based offset of the BBjKeySegment.

Remarks

This value is zero-based. When a file is created using the MKEYED, XKEYED, or VKEYED verb, the offset is specified as a one-based value.

 

Example

rem ' Query attributes of a BBjKeySegment

filename$ = "Sample.dat"
erase filename$,err=*next
mkeyed filename$,[1:1:6]+[2:1:3],[3:1:2],0,64
channel = unt
open (channel)filename$
BBjFileInfo! = BBjAPI().getFileSystem().getFileInfo(channel)
BBjKeyInfos! = BBjFileInfo!.getKeyInfo()
for k = 0 to BBjKeyInfos!.size()-1
    BBjKeyInfo! = BBjKeyInfos!.get(k)
    print "KNUM",k,": ",BBjKeyInfo!
    BBjKeySegments! = BBjKeyInfo!.getKeySegments()
    for s = 0 to BBjKeySegments!.size()-1
        BBjKeySegment! = BBjKeySegments!.get(s)
        print "   Segment",s,": ",BBjKeySegment!
        print "      Field:",BBjKeySegment!.getField()
        print "      Offset:",BBjKeySegment!.getOffset()," (zero-based)"
        print "      Length:",BBjKeySegment!.getLength()
        print "      Descending? ",fnyesno$(BBjKeySegment!.isDescending())
        print "      Numeric? ",fnyesno$(BBjKeySegment!.isNumeric())
    next s
next k
stop
def fnyesno$(bool) = iff(bool,"Yes","No")
end

See Also

BBjAPI

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