Seeing the past in QTP
Pat Shugart
ShugartP at trinity-health.org
Tue May 23 13:27:21 CDT 2006
Richard,
You may be able to use the concepts from this. I haven't used it in years, so I can't say whether or not it'll work with the most recent versions of PH or not but you never know. I do recall that I couldn't save data a record at a time * I had to break it up into each field.
Give it a shot, it may just work for you...
HTH
;*********************************************************************
;* Program Name: RECURSIV *
;* Written By: Patrick Shugart, Oaksoft Consulting/WL Software *
;* *
;* Description: *
;* This program illustrates how you can "hold onto" the previous *
;* value of a field in QTP. *
;* *
;* Modification History: *
;* *
;* Date Who Mod # Description *
;*-------- --- ------- ----------------------------------------- *
;*12/02/93 PRS Initial implementation *
;* *
;*********************************************************************
set input limit 10
run dummy
;These will 'carry over' the current value of the field to
;the next record.
global temporary g-prev-member# character * 12 initial ' '
global temporary g-prev-ssn character * 10 initial ' '
;---------------------------------------------------------------------
request prev-record-demo
access member
;Initialize the hold fields if you so desire, otherwise, they
;will show up as empty.
item g-prev-member# initial member# of member
item g-prev-ssn initial ssn of member
;Here's where you could do some comparisons to the previous
;value of the fields and take action on it.
;define
;output/subfile
;select
;In this example, we'll write to a subfile and report on it
;later to prove we can hold onto the previous record.
subfile prevrec size 100 &
include member# of member, &
prev-member#, &
ssn of member, &
prev-ssn
;Here's where we 'hold onto' the current value of the fields and
;they will carry over to the next record. IMPORTANT: These item
;statements must follow any/all output actions by QTP or this
;will not work.
item g-prev-member# = member# of member
item g-prev-ssn = ssn of member
;---------------------------------------------------------------------
;Next request or GO
---
Pat Shugart
Senior Analyst
Trinity Information Services
34605 W. Twelve Mile Rd
Farmington Hills, MI 48331
248.489.6123
248.488.9195 (fax)
(\__/)
(O.o )
(> < ) <-- This is Bunny. Copy Bunny into your signature to help him on his way to world domination.
>>> "Richard Witkopp" <RWitkopp at phxa.com> 5/23/2006 2:18:04 PM >>>
How do I retain data from each record so that I can use it when reading
subsequent records? Essentially I want to have a temporary that eventually
contains a string that looks like this:
"data from 1st rec" "data from 2nd rec" "data from 3rd rec" ...
I'm an old crusty rusty Powerhoser that's been reincarnated, except for my
memory. I thought I had done this in the past, but I've forgotten many of
the quirks of Phouse.
NOTICE: The information contained in this e-mail and any attachments is
confidential and may be privileged or otherwise protected from disclosure.
This e-mail is intended solely for the use of the named addressee. Any other
use, printing, copying, disclosure or dissemination may be subject to legal
restriction. If you are not the intended recipient, please contact the
sender and delete all copies including any attachments.
--
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l at lists.sowder.com
Subscribe: "subscribe" in message body to powerh-l-request at lists.sowder.com
Unsubscribe: "unsubscribe <password>" in message body to powerh-l-request at lists.sowder.com
http://lists.sowder.com/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.
Add 'site:lists.sowder.com powerh-l' to your search terms to search the list archive at Google.
More information about the powerh-l
mailing list