_CP_read

_CP_read


_CP_prompt Index Level _CP_readnext
Syntax int _CP_read(int type, CPSTR** result, int expression, CPSTR* string, int* value)
Category C Interface
Type C Function
Description equivalent to the FlashBASIC statements depending upon type: read, readu, readu locked

type        FlashBASIC statement

_CP_READ    read result from expression,string

_CP_READU   readu result from expression,string

_CP_READUL  readu result from expression,string locked value = 1 else value = 0

If value is not needed, the user may pass (int*) 0.

The _CP_read call uses the same optimized read routine as FlashBASIC which, from release 6.1 and above, is about 2-5 times faster than that which is used by Access and standard Pick/BASIC.

The expression should be an integer file descriptor returned by the _CP_open call.

This function returns -1 if an error occurs. The error code is contained in _CP_errno.
Options
See Also C Functions introduction _CP_write _CP_writev
Example The following example reads the item "myid" from "myfile".

CPSTR * s = _CP_mkstr("myfile");
CPSTR * id = _CP_mkstr("myid");
CPSTR * xx = _CP_str_null;
int f;

_CP_open(&f,_CP_str_null,s);
_CP_read(_CP_READ, &xx, f, id, 0);
Warnings
Compatibility AP 6.1
_CP_prompt Index Level _CP_readnext