CPDB.Net  [fr]  [en] 
News  Downloads  Forum
4- Fields operations



Introduction

In the current version, 4 types of fields are supported :



 

Read a string field

Use the following example :





Err err;
MemHandle handle;
Char *string;

err = CPDB_ReadString(mydbHandle, "FIELDNAME", &handle);
if (err == 0)
{
string = MemHandleLock(handle);
// Use the string now
// ...
// Free the string
MemHandleUnlock(handle);
MemHandleFree(handle);
}

Important : the CPDB_ReadString function allocate the memory for you, so you must free this memory after use.


 

Read a numeric field

Use the following example :


Short integer :


Int8 int8;
err = CPDB_ReadShortInt(hOREST, "FIELDNAME", &int8);

Integer :

Int16 int16;
err = CPDB_ReadInt(hOREST, "FIELDNAME", &int16);

Long integer :

Int32 int32;
err = CPDB_ReadLongInt(hOREST, "FIELDNAME", &int32);


 

More information

CPDB_ReadShortInt


CPDB_ReadInt


CPDB_ReadLongInt


CPDB_ReadString


Creation date : 01/10/2003 @ 06:33
Last update : 01/10/2003 @ 07:27
Category : CPDB library
Page read 10189 times

Top


GuppY - http://www.freeguppy.org/
Site running with GuppY v3.1 - GNU Public License - © 2002-2024

Page loaded in 0.02 second