CHOOSE and SELECT in QTP

Bill D Michael Bill.Michael@ipaper.com
Thu, 25 Jan 2001 09:15:40 -0600


I would prompt for the user's selection as a GLOBAL TEMP, then have two
different requests:

REQUEST A EXECUTE IF GT_PARM = "A"
--do your CHOOSE "A@" processing here

REQUEST OTHERS EXECUTE IF GT_PARM <> "A"
--do your SELECT IF product_item[1:1] <> "A" processing here.

Regardless of how you word it, the "not A" case will have to read the
entire file or almost all of the file - the quickest way therefore is
likely to be a simple serial read, as you've seen.

Bill





"Bourchi, H." <bourchih@unive.nl>@sphere.swau.edu on 01/25/2001 08:02:29 AM

Sent by:  owner-powerh-l@sphere.swau.edu



To:   "'powerh-l@sphere.swau.edu'" <powerh-l@sphere.swau.edu>
cc:
Subject:  CHOOSE and SELECT in QTP


Possible choices has to be:
1-    "A############" products
2-   rest of the products.

My first solution was:

access product_table
define product_choice char*1 = parm
choose product_item (case of product_choice        &
               when "A" : "A@"                &
               when "L" :  "B@@")
Do processing ...

In case of A was QTP in 5 minutes finished and in case of L in 92 minutes!
92 minutes processing time seemed a bit strange. So I tried to campare it
with a SELECT statement construction:

access product_table
define product_choice char*1 = parm
select if product_item[1:1] <> "A"

Do processing ...

I was surprised when I saw a SELECT statement construction is almost 5
times
faster then a CHOOSE statement; Qtp was in 16 minutes finished.



= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.