FormatNumber Performance in QTP
Deskin, Bob
Bob.Deskin@Cognos.COM
Thu, 27 Sep 2001 07:18:43 -0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C14746.2AFA3CD0
Content-Type: text/plain;
charset="iso-8859-1"
While we have not tested this, I'd say the two are probably about the same.
I doubt you'd see any measurable difference. While the first uses two
DEFINEs the FORMATNUMBER function is more complex. Of course the two DEFINE
method actually executes the first DEFINE twice because of the way it's
referenced. But even embedding the ASCII function twice into the second
define wouldn't change much.
Bob Deskin
PowerHouse Web Product Manager, Application Development Tools, Cognos Inc.
bob.deskin@cognos.com (613) 738-1338 ext 7268 FAX: (613) 727-1178
3755 Riverside Drive P.O. Box 9707 Stn. T, Ottawa ON K1G 4K9 CANADA
-----Original Message-----
From: Robert Mills [mailto:robert.mills@windsong-services.co.uk]
Sent: Thursday, September 27, 2001 6:42 AM
To: 'PowerHouse List'
Subject: FormatNumber Performance in QTP
Hi fellow list members,
We are about to release 8.39C into our production environment (it replaces
8.19D7).
Currently in QTP we have been using the following code to convert numeric
fields to edited character fields:
Define d-AMOUNT-1 Character *15 &
= Ascii(LEDG-VALUE-GROSS Of CM000EX1,15)
Define d-CURRENCY-AMOUNT Character *16 &
= d-AMOUNT-1[1:13] &
+ "." &
+ d-AMOUNT-1[14:2]
When we have upgraded to 8.39, we can replace the above two (2) defines with
the following:
Define d-CURRENCY-AMOUNT Character *16 &
= FormatNumber(LEDG-VALUE-GROSS Of CM000EX1,"0000000000000.00")
Apart from making the programs more easily readable is there any performance
advantage in doing this change?
regards,
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Robert W.Mills (Systems Development Manager) |
|Windsong Services, St. Mary Cray, ENGLAND |
|Tel : +44 (0)1689 870622 x3005 |
|Fax : +44 (0)1689 899026 |
|Email: Robert.Mills@windsong-services.co.uk |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender by
e-mail promptly that you have done so. Thank You.
------_=_NextPart_001_01C14746.2AFA3CD0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<TITLE>FormatNumber Performance in QTP</TITLE>
<META content=3D"MSHTML 5.50.4807.2300" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D219381411-27092001>While=20
we have not tested this, I'd say the two are probably about the same. I =
doubt=20
you'd see any measurable difference. While the first uses two DEFINEs =
the=20
FORMATNUMBER function is more complex. Of course the two DEFINE method =
actually=20
executes the first DEFINE twice because of the way it's referenced. But =
even=20
embedding the ASCII function twice into the second define wouldn't =
change=20
much.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D219381411-27092001>
<P><FONT face=3DArial size=3D2>Bob=20
Deskin =
=20
</FONT><BR><FONT face=3DArial size=3D2>PowerHouse Web Product Manager, =
Application=20
Development Tools, Cognos Inc.</FONT> <BR><FONT face=3DArial=20
size=3D2>bob.deskin@cognos.com (613) 738-1338 ext 7268 FAX: (613) =
727-1178</FONT>=20
<BR><FONT face=3DArial size=3D2>3755 Riverside Drive P.O. Box 9707 Stn. =
T, Ottawa ON=20
K1G 4K9 CANADA</FONT> </P></SPAN></FONT></DIV>
<BLOCKQUOTE>
<DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
size=3D2>-----Original Message-----<BR><B>From:</B> Robert Mills=20
[mailto:robert.mills@windsong-services.co.uk]<BR><B>Sent:</B> =
Thursday,=20
September 27, 2001 6:42 AM<BR><B>To:</B> 'PowerHouse =
List'<BR><B>Subject:</B>=20
FormatNumber Performance in QTP<BR><BR></FONT></DIV>
<P><FONT size=3D2>Hi fellow list members,</FONT> </P>
<P><FONT size=3D2>We are about to release 8.39C into our production =
environment=20
(it replaces 8.19D7).</FONT> </P>
<P><FONT size=3D2>Currently in QTP we have been using the following =
code to=20
convert numeric fields to edited character fields:</FONT> </P>
<P><FONT size=3D2> Define=20
=
d-AMOUNT-1 &n=
bsp;=20
Character=20
=
*15 &nb=
sp; &nb=
sp;=20
&</FONT> <BR><FONT size=3D2> =
=3D=20
Ascii(LEDG-VALUE-GROSS Of CM000EX1,15)</FONT> </P>
<P><FONT size=3D2> Define =
d-CURRENCY-AMOUNT =20
Character=20
=
*16 &nb=
sp; &nb=
sp;=20
&</FONT> <BR><FONT size=3D2> =
=3D=20
=
d-AMOUNT-1[1:13] &n=
bsp; &n=
bsp; &n=
bsp; =20
&</FONT> <BR><FONT size=3D2> =
+=20
=
"." &nb=
sp; &nb=
sp; &nb=
sp; &nb=
sp; =20
&</FONT> <BR><FONT size=3D2> =
+=20
d-AMOUNT-1[14:2]</FONT> </P>
<P><FONT size=3D2>When we have upgraded to 8.39, we can replace the =
above two=20
(2) defines with the following:</FONT> </P>
<P><FONT size=3D2> Define =
d-CURRENCY-AMOUNT =20
Character=20
=
*16 &nb=
sp; =20
&</FONT> <BR><FONT size=3D2> =
=3D=20
FormatNumber(LEDG-VALUE-GROSS Of CM000EX1,"0000000000000.00")</FONT> =
</P>
<P><FONT size=3D2>Apart from making the programs more easily readable =
is there=20
any performance advantage in doing this change?</FONT> </P>
<P><FONT size=3D2>regards,</FONT> <BR><FONT=20
size=3D2>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</FONT> =
<BR><FONT=20
size=3D2>|Robert W.Mills (Systems Development Manager) |</FONT> =
<BR><FONT=20
size=3D2>|Windsong Services, St. Mary Cray, ENGLAND =
|</FONT>=20
<BR><FONT size=3D2>|Tel : +44 (0)1689 870622=20
=
x3005 &=
nbsp; =20
|</FONT> <BR><FONT size=3D2>|Fax : +44 (0)1689=20
=
899026 =
=20
|</FONT> <BR><FONT size=3D2>|Email: =
Robert.Mills@windsong-services.co.uk =20
|</FONT> <BR><FONT=20
size=3D2>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</FONT>=20
</P><BR></BLOCKQUOTE></BODY></HTML>
<P><FONT SIZE=3D2 FACE=3D"Arial">This message may contain privileged =
and/or confidential information. If you have received this e-mail in =
error or are not the intended recipient, you may not use, copy, =
disseminate, or distribute it; do not open any attachments, delete it =
immediately from your system and notify the sender by e-mail promptly =
that you have done so. Thank You.</FONT></P>
------_=_NextPart_001_01C14746.2AFA3CD0--