Solution: Using ALTEREDRECORD in QTP
Chris Sharman
chris.sharman@ccagroup.co.uk
Mon, 04 Aug 2003 09:22:47 +0100
dennis@dhassell.com wrote:
> IIRC (it's been a few years), open a second copy of the file for output,
> with an alias name. Then look up on A and update on A_ALIAS. You'll need
> a unique key to link the lookup to the output.
>
> Inside the program, make all the changes to A_ALIAS, and test for
> ALTEREDREC of A_ALIAS for the condition below.
>
> I'm curious, though - the UPDATE won't happen unless there is a
> condition of ALTEREDRECORD anyway, and then the FINAL kicks in. I think
> the condition is redundant.
>
> I've found QTP to be tough to work with when depending on the ITEM
> statements and IF conditions for anything much more than simple data
> transformation. I usually use the selection criteria to handle all of
> the if conditions, so everything selected (input phase) gets sorted
> (sort phase) and output (output phase). Input and output phases work
> differently with the conditions, so read up on them in the QTP manual.
iirc, using "item vendor_zip = vendor_zip + 1" (= rather than final)
will have the desired effect, although there's an example in the qtp
manual which suggests your code is correct as-is, so I'm not sure.
Chris
-----------------------------------------------------------------------
Any views expressed in this message are those of the sender and not
necessarily those of CCA Group. The unauthorized use, disclosure,
copying or alteration of this message is forbidden. The contents of
this message may be confidential and/or privileged, copyright CCA Group
and are intended solely for the use of the individual or entity to whom
they are addressed. Whilst this message has been scanned, CCA Group
cannot guarantee that it is virus free or compatible with your systems
and accepts no responsibility for any loss or damage arising from its
use. The recipient is advised to run their own anti-virus software. If
you receive this message in error please contact
postmaster@ccagroup.co.uk immediately, destroy any copies and delete it
from your computer systems.