cfunc.root

C Function/C Functions, Releases: AP 6.1

Pick/BASIC 'root' functionality from C.

Syntax

int _CP_root(CPSTR* string1, CPSTR* string2, int* result)

Description

equivalent to the Pick/BASIC statement: root string1, string2 to result.

This function returns -1 if an error occurs. The error code is contained in _CP_errno.

Example

/* The following gets the first item-id which contains 'a' as
attribute 1. */

CPSTR * n = _CP_mkstr('myfile');
CPSTR * a = _CP_mkstr('a1');
CPSTR * op = _CP_mkstr('n');
CPSTR * k = _CP_mkstr('a');
CPSTR * i = _CP_str_null;
int r,dummy;

_CP_root(n,a,&r);
_CP_key(op,r,&k,&i,&dummy);

See Also

Command Name Type Description
cfunc.introduction Introductory Overview

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.