[C SDK] Reading values from cursor

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Nov 4 22:27:51 CST 2003


on 11/4/03 17:07, Olaf Schmidtmann at os at brainbits.net wrote:

Hi Olaf,

> my link between Valentina and Flash seems to work now:
> I can create cursors by sql selects, get references, field counts, record
> counts...
> But when it comes to getting field types, names and values it still does not
> work as it should. It seems that I get integers for these and not string for
> example :-(
> 
> Something like this:
> 
> [
> {
> fRef: 44076136
> fName: 44201312
> fType: 15
> fValue: 20024512
> }
> {
> fRef: 44063884
> fName: 44201312
> fType: 10
> fValue: 44199248
> }
> ...
> 
> I create a cursor and do something like this to get these values:
> 
> // fRef is my field reference
> fName = Field_GetName(fRef)
> fType = Field_GetType(fRef)
> fValue = Field_GetString(fRef) // Should work for almost everything, right?

Please show me more your sources.
For example how you have declare fName?
Have you declare it as

    char* fname?

It looks like you assign char* (in C terms "string pointer") to NUMBER.


ALSO, import "strange" feature of VCSDK is that it return you string
pointer...and you need COPY that string to OWN buffer immediately, because
any other operation that also return char* will reuse that buffer.

I still not sure this was good decision...
C libraries usually not work in this way...
On the other hand this way IMHO still simpler of its alternatives.


> Do you have any idea?
> DebugView does not report something special - everything seems to work.
> Of course it could be that my interface to access the DLL fails but they say
> it works with boolean, integer, string.

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list