=?iso-8859-1?Q?R=E9f=2E_=3A_Converting_string_characters_in_QTP?=

nicolas.au@bnpparibas.com nicolas.au@bnpparibas.com
Wed, 17 Oct 2001 14:06:53 +0200


Hi Graeme,

The following QTP's codes worked fine on HP3000 (MPE/iX 6.5) and PH8.29.
It uses the MPE function 'REPL' to do the job.

I am not sure about whether this will work on other platform.
However, the Powerhouse functions GETSYSTEMVAL and SETSYSTEMVAL are
available in MPE and Unix versions.

Good luck,

Nicholas.


The demo QTP source :

RUN XXYY

;  This demo program will replace any occurrence of "," in T-AA  with ";" in T-BB
;  using the HP3000 system function REPL.

ACCESS any-dataset         ; or any file
CHOOSE  key-item  parm prompt 1 times         ; or use select if you want

TEMP  T-AA  CHAR*40
TEMP  T-BB  CHAR*40
TEMP  T-CC  CHAR*1       ; this is a dummy variable

ITEM  T-AA = "Column 1,  6789.12,  Column 2,  456.78"    ; any string you want to test

ITEM  T-CC = "Y" &
       IF SETSYSTEMVAL("VAR_AA",(T-AA))

ITEM  T-CC = "Y" &
       IF SETSYSTEMVAL("VAR_BB","![REPL(VAR_AA,',',';')]")

ITEM T-BB = GETSYSTEMVAL("VAR_BB")

SUBFILE XYXYSF   INCLUDE &
T-AA, &
T-BB

GO

============================

Now you can use QUIZ to see the content in subfile XYXYSF.

> acc *xyxysf
> rep all
> go

  T-AA

  T-BB

  Column 1,  6789.12,  Column 2,  456.78
  Column 1;  6789.12;  Column 2;  456.78

============================

Good luck,

Nicholas.




Internet
Graeme.Lemin@team.telstra.com@cube.swau.edu - 16/10/2001 23:51


Envoyé par :   powerh-l-admin@cube.swau.edu

Pour :    powerh-l

cc :

ccc :


Objet :   Converting string characters in QTP




     Hello Powerusers,

     Can any one suggest how to convert commas in a string into another
character in QTP?

     For a while it seemed the SUBSTITUTE function could work.  On closer
inspection, it seems to depend on having the facility to change the default
substitution character "^", which alas does not seem possible.

     The strings in question will have a variable number of unwanted
commas, so either an iterative solution with Quick or another language may
be necessary.  The preferred tool would be QTP if possible.  Any ideas
gratefully welcomed!

     Regards,

     Derek Fyfield.

     IT Media Solutions
     03 8696 5968


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





This message and any attachments (the "message") is
intended solely for the addressees and is confidential. 
If you receive this message in error, please delete it and 
immediately notify the sender. Any use not in accord with 
its purpose, any dissemination or disclosure, either whole 
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message. 
BNP PARIBAS (and its subsidiaries) shall (will) not 
therefore be liable for the message if modified. 

                ---------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le 
"message") sont etablis a l'intention exclusive de ses 
destinataires et sont confidentiels. Si vous recevez ce 
message par erreur, merci de le detruire et d'en avertir 
immediatement l'expediteur. Toute utilisation de ce 
message non conforme a sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf 
autorisation expresse. L'internet ne permettant pas 
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce 
message, dans l'hypothese ou il aurait ete modifie.