A QUIZ Problem/Challenge
Pickering, John (NORBORD)
PICKERIJ@norbord.com
Thu, 7 Dec 2000 16:33:21 -0500
You say Quiz but this is a reasonably straight forward (although cpu
killing) task in Qtp. Am I allowed to switch tools?
Take the record and strip off the PO & Line stuff. You can figure out how to
do it -- either it has a fixed length or it ends at the second "/" -- either
way it isn't difficult.
Then assign the reset of the record to a big work area that I'll call
T-WORK. Break it up into 21 pieces using the "/". Write out 21 subfile
records, each with the PO & Line stuff plus one description. Condition these
subfile statements on a non blank description.
>temp T-WORK char*200 ; or something big enough for 21 descs
>item T-WORK = the input buffer minus the PO & Line stuff
>temp T-POS int*5
>item T-POS = index(T-WORK,"/")
>temp T-DESC1 char*30
>item T-DESC1 = T-WORK[1:T-POS - 1]
>item T-WORK = lj(T-WORK[T-POS + 1:200])
>subfile sf alias sf-1 if T-DESC1 ne "" inc &
> PO & Line stuff, T-DESC1
Repeat the last 6 lines 20 more times (shudder) for T-DESC2 through
T-DESC21.
Regards,
JWP
> -----Original Message-----
> From: Karman, Al [SMTP:AKarman@USFreightways.com]
> Sent: Thursday, December 07, 2000 4:01 PM
> To: 'powerh-l@lists.swau.edu'
> Subject: A QUIZ Problem/Challenge
>
> Greetings to the list.....this is one of those that's probably got a
> painless solution...
>
> I have a subfile setup like this:
> PO#/LINE#/Description 1 ... Description 21
>
> Which gives me a unique record for each PO#/LINE#
>
> Now, the problem/challenge. First, for the description 1/description 21,
> they may not all be populated (always consecutive, may get desc1 => desc9,
> next record desc 1 => desc5).
>
> Here it comes....I'm looking for a fairly elegant way to
> - Have 1x read to the subfile, and
> - Have that produce anywhere from 1 to 21 UNIQUE new subfile entries
> I can then use to QTP them into a dataset which
> describes the
> PO#/LINE#
>
> e.g.
> RECORD#1 from input file....
>
> PO#123/LINE#6789/'This product'/'can be used'/'to remove the
> hair'/'growing
> on your palms'
>
> would create 4x records like
> PO#123/LINE#6789/'This product'
> PO#123/LINE#6789/'can be used'....
>
> You get the picture....! I also need a counter to increment but I can
> figure that out...!
>
> I'm fooling with stuff like defining fields as blank based upon
> description
> n = spaces, etc. but I'm also thinking there's gotta be Something out
> there.....
>
> A BIG Thanks in Advance to all respondents!
>
> Al Karman
> IT Consultant
> US Freightways
> akarman@usfreightways.com
> 773.824.2284
>
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
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.