get()  size()

Chapter 5: General Objects and Methods

get()

Description

Retrieves a string pair given an index.

Syntax

int get(int index, string *pKey, string *pElement);

Parameter

Description

index

Index into the clMap of which key/element pair to retrieve. The first pair has an index value of zero.

pKey

Pointer to the location to put the key value in once retrieved.

pElement

Pointer to the location to put the element value in once it is retrieved.

Return value

Integer. Returns 1 if data is retrieved; otherwise, returns 0.

Usage

Takes an integer and two string pointers as parameters. The integer is used as an index to indicate which string pair to retrieve in the object. Notice the ordering of string pairs does not equal the order in which they were added to the object. The two string pointers are used for returning the string pair.

Pointer to object

Object

string key;

string element;

pclMapObj->get    (3, &key, &element);

string key;

string element;

myclMapObj.get    (3, &key, &element);





Copyright © 2005. Sybase Inc. All rights reserved. size()

View this book as PDF