Eric
Member
|
ListColumn with custom Str data_to_text func
Hello,
lately I've tried to create a list column with my custom Str data_to_text function (it returns only date, without hours from DateTime). Here's the body:
Code:
Str DateFromDT(C DateTime &dt)
{
return dt.asText(false).clip(10);
}
and here's the column constructor I use:
Code:
ListColumn date_list_column[]=
{
ListColumn(DateFromDT(MEMBER(Player, date)), 0.50f, L"date"),
}
After starting the application I get this error pointed on my function:
Code:
Unhandled exception at 0x00(...).: Access violation reading location 0x00(...)
and I have no idea what's wrong with this function Maybe you have?
Regards,
Eric 'Eri' Przychocki
ourgames.eu
|
|
01-31-2014 04:00 PM |
|
Esenthel
Administrator
|
RE: ListColumn with custom Str data_to_text func
Hi,
You need to do:
Code:
Str DateFromDT(C DateTime &dt)
{
return dt.asText(false).clip(10);
}
Str PlayerDate(C Player &plr) {return DateFromDT(plr.date);}
ListColumn(MemberDesc(MEMBER(Player, date)).setDataToTextFunc(PlayerDate), ..
You can check this tutorial for something similar:
"16 - Properties"
|
|
02-01-2014 10:28 PM |
|
Eric
Member
|
RE: ListColumn with custom Str data_to_text func
Of course you mean "setDataToTextFunc"
Thank you!
Regards,
Eric 'Eri' Przychocki
ourgames.eu
|
|
02-02-2014 11:19 AM |
|
Esenthel
Administrator
|
RE: ListColumn with custom Str data_to_text func
yes, sorry, I've updated my previous post
|
|
02-03-2014 08:51 PM |
|