Character Replacement

Pickering, John (NORBORD) PICKERIJ@norbord.com
Tue, 27 Feb 2001 15:19:08 -0500


You indicate that the source of the problem is Quick. So first stop letting
the users enter the junk which causes the problems. In Quick you could add a
pattern to the field statement limiting the allowable entries or loop
through the field using a "FOR ii" where ii is the length of the item
removing the offending characters with your INDEX and [] suggestion.

Now you have reduced the Qtp task to a one time fix. So who cares if you
have to pass through the data "two or twenty" times? Maybe look for half a
dozen problem characters at a time. Pass through the file until you don't
find anything to fix. Remember it's a one time fix!

Regards,
JWP

> -----Original Message-----
> From:	Bill D Michael [SMTP:Bill.Michael@ipaper.com]
> Sent:	Tuesday, February 27, 2001 2:14 PM
> To:	powerh-l@sphere.swau.edu
> Subject:	Character Replacement
> 
> Looking for a way in QTP (or Quiz) to replace all occurances of a single
> character in a field with another character - for example, the record
> might
> contain "---- this is a test ----", and I want to update it to contain "
> ==== this is a test ====". Primarily because we have users entering
> "illegal" characters into text fields on Quick screens that cause problems
> much later, such as quotes, slashes, and @ signs.
> 
> The manual refers to a "substitution character", ^, but I believe this is
> only for error messages and such and can't be used for what I want here. I
> can replace a single occurrance using INDEX and the [] syntax, but since
> there could be two or twenty, I'd have to run "n" requests to accomplish
> the whole thing.
> 
> Bill
> 
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
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.