Re: [gnome-db] problem with g_value_get_int()



that really help..
thank you..

On 10/3/08, Daniel Espinosa <esodan gmail com> wrote:
> You have to init the GValue pointer first. You can use:
>
>
> For upcomming Version 4.0 (the main difference is at GdaDataModel API)
>
> GdaDataModel *model;
> const GValue *integer;
> GError *error = NULL;
>
> integer = gda_value_new (G_TYPE_INT);
>
> integer = gda_data_model_get_value_at  (model, 0, 0, &error);
> /* All values in a Data Model must be unmodificable then use const GValue,
> this
> will avoid compilation warnings */
>
> Or can use (gda_value_new makes this for you :-)
>
> integer = g_new0 (GValue. 1);
>
> g_value_init (inteteger, G_TYPE_INT);
>
>
>
> 2008/10/3 paragasu <paragasu gmail com>
>
>> the code
>>
>> GdaDataModel *dm;
>> gint i;
>> i = g_value_get_int (gda_data_model_get_value_at (dm, 0, 0));
>>
>> output error
>>
>> **CRITICAL : assertion G_VALUE_HOLDS_INT (value) failed
>>
>> but if i do
>> i = (atoi) gda_value_stringfy (gda_data_model_get_value_at (dm, 0, 0));
>>
>> i have i = 10,
>> which say gda_data_model_get_value_at return correct value.
>> now, why g_value_get_int doesn't work as it supposed to. how to use
>> g_value_get_int correctly?
>>
>> thank you
>> _______________________________________________
>> gnome-db-list mailing list
>> gnome-db-list gnome org
>> http://mail.gnome.org/mailman/listinfo/gnome-db-list
>>
>
>
>
> --
> Trabajar, la mejor arma para tu superación
> "de grano en grano, se hace la arena" (R) (en trámite, pero para los cuates:
> LIBRE)
>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]