[fpc-devel] RFC: customvariant handling in variants.pp and fmtbcd.pp

2011-03-23 Thread LacaK
Hi, I would like ask for your opinion in this case. I found, that in this sample program is raised Invalid variant ... var bcd1: TBCD; v,v1: variant; s: string; begin bcd1:=2; v1:=varfmtbcdcreate(bcd1); s:=v1; //assigment from customvariant to string is not handled in

Re: [fpc-devel] RFC: customvariant handling in variants.pp and fmtbcd.pp

2011-03-23 Thread Sergei Gorelkin
LacaK пишет: I can fix it by following fixs: 1. fmtbcd_castto.diff ... added case when castto varString is requested ... then do not use cast throught varDouble (to avoid lost of precision), but convert directly from TBCD to string 2. variants.pp ... here we must add handling of

Re: [fpc-devel] RFC: customvariant handling in variants.pp and fmtbcd.pp

2011-03-23 Thread LacaK
Hi Sergei, I can fix it by following fixs: 1. fmtbcd_castto.diff ... added case when castto varString is requested ... then do not use cast throught varDouble (to avoid lost of precision), but convert directly from TBCD to string 2. variants.pp ... here we must add handling of

Re: [fpc-devel] RFC: customvariant handling in variants.pp and fmtbcd.pp

2011-03-23 Thread Sergei Gorelkin
LacaK пишет: Hi Sergei, I can fix it by following fixs: 1. fmtbcd_castto.diff ... added case when castto varString is requested ... then do not use cast throught varDouble (to avoid lost of precision), but convert directly from TBCD to string 2. variants.pp ... here we must add handling