BBjObjectTable::size

Description

In BBj 5.0 and higher, this method retrieves the number of keys in the table.

Syntax

Return Value

Method

int

size()

Parameters

None.

Return Value

Returns the number of the keys in the table.

Remarks

None.

Example

REM Get the number of keys in the BBjObjectTable

REM Obtain the instance of the BBjAPI object
LET myAPI!=BBjAPI()

REM Obtain the instance of the BBjObjectTable object
LET StateObjectTable!=myAPI!.getObjectTable()

REM Load the BBjObjectTable
while 1
    DREAD STATE_KEY$,STATE_NAME$,ERR=*BREAK
    REM Add the key/value pair into the BBjObjectTable
    StateObjectTable!.put(STATE_KEY$, STATE_NAME$)
wend

REM Get the number of keys in the BBjObjectTable
PRINT "There are",StateObjectTable!.size()," keys in the table"

DATA "AK","Alaska"
DATA "AL","Alabama"
DATA "AR","Arkansas"
DATA "AZ","Arizona"
DATA "CA","California"
DATA "CO","Colorado"
DATA "CT","Connecticut"
DATA "DC","District of Columbia"
DATA "DE","Delaware"
DATA "FL","Florida"
DATA "GA","Georgia"
DATA "GU","Guam"
DATA "HI","Hawaii"
DATA "IA","Iowa"
DATA "ID","Idaho"
DATA "IL","Illinois"
DATA "IN","Indiana"
DATA "KS","Kansas"
DATA "KY","Kentucky"
DATA "LA","Louisiana"
DATA "MA","Massachusetts"
DATA "MD","Maryland"
DATA "ME","Maine"
DATA "MI","Michigan"
DATA "MN","Minnesota"
DATA "MO","Missouri"
DATA "MS","Mississippi"
DATA "MT","Montana"
DATA "NC","North Carolina"
DATA "ND","North Dakota"
DATA "NE","Nebraska"
DATA "NH","New Hampshire"
DATA "NJ","New Jersey"
DATA "NM","New Mexico"
DATA "NV","Nevada"
DATA "NY","New York"
DATA "OH","Ohio"
DATA "OK","Oklahoma"
DATA "OR","Oregon"
DATA "PA","Pennsylvania"
DATA "PR","Puerto Rico"
DATA "RI","Rhode Island"
DATA "SC","South Carolina"
DATA "SD","South Dakota"
DATA "TN","Tennessee"
DATA "TX","Texas"
DATA "UT","Utah"
DATA "VA","Virginia"
DATA "VI","Virgin Islands"
DATA "VT","Vermont"
DATA "WA","Washington"
DATA "WI","Wisconsin"
DATA "WV","West Virginia"
DATA "WY","Wyoming"

See Also

BBjAPI

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