Re: Strange behaviour of TRANSFORM function by Stefan
Stefan
Wed Aug 11 03:17:01 CDT 2004
Hi Devapriya,
Your code works as expected in Vfp8 SP1
However, memo content does not always behave _exactly like a
character string does - if so, you can add an "" beforehand, e.g.
CREATE CURSOR temp (test M)
INSERT INTO temp VALUES (REPLICATE('x',500))
#if VERSION(5) >= 800
? LEN(TRANSFORM(test)) && returns 500 in Vfp8/9
#else
? LEN(TRANSFORM(""+test)) && works in Vfp7
#endif
BTW, Transform() was improved in Vfp8 anyway and also
works much faster now than it did previously
hth
-Stefan
"Devapriya De Silva" <ddesilva@qa-software.com> schrieb im Newsbeitrag
news:eTAcDf1fEHA.1188@TK2MSFTNGP11.phx.gbl...
> I write a function ("MyFunc(Transform(Expr),"A",12") to the Expr field in a
> report.(copy of the report)
> Then when the report is run it evaluates my function and then myfunction
> writes the contents to a text file.
> This text file is then processed.
>
> The field type that is mapped to the report could be numeric, logical, date
> etc., and therefore I have to use transform.
>
> Thanks anyway.
> Kind Regards,
> Devapriya De Silva
>
> "Roger Ansell" <notmyreal@emailaddress.com> wrote in message
> news:2ns0htF3p8lmU1@uni-berlin.de...
> > You're right. I get the same results.
> > However, why would you want to use Transform on memo field?
> > The documentation says that no transformation is performed.
> > Ah well, back to work.
> >
> > -Roger
> > --
> > Roger Ansell
> > Adelaide, Australia
> >
> > My real email address is ransell at senet dot com dot au
> >
> > "Devapriya De Silva" <ddesilva@qa-software.com> wrote in message
> > news:%236wKVAtfEHA.3024@TK2MSFTNGP10.phx.gbl...
> > Hi gurus,
> >
> > I am using VFP7 SP1.
> >
> > This result is correct:
> > ?LEN(MyTable.MyMemoField)
> > 558
> >
> > This result is incorrect:
> > ?LEN(TRANSFORM(MyTable.MyMemoField))
> > 256
> >
> > lcText = MyTable.MyMemoField
> > ?LEN(TRANSFORM(lcText))
> > 558
> >
> > If i try this in VFP 7 without the SP or in VFP 8, I get 558 in all
> > instances.
> > Have anybody faced an issue as such?
> >
> > Kind Regards,
> > Devapriya De Silva
> >
> >
> >
>
>