cfunc.read
Pick/BASIC 'read' functionality from C.
Syntax
int _CP_read(int type, CPSTR** result, int expression, CPSTR* string, int* value)
Description
equivalent to the Pick/BASIC statements depending upon type: read, readu, readu locked
type Pick/BASIC 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 the 6.1 release onwards, 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.
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);
See Also
User Comments
What do you think?
Share your experience or ask a question by using the form below.
Login to leave your comments.
