For each searching for Control Codes

Charles Givens

New Member
We have some descriptions that get loaded from the vendor that have the TM symbol in them. We are moving to a WebUI environment and this messes with the searches. Anyway, I need to find them and replace them, but I am at a loss on how the for each state would accomplish that. When I look at the data TM is display, but the actual control code for it is Alt0153. I am sure this has been done, can someone please help me. I am progress aware, just do not know how to find them. I probably could go thru each character and check to see if it is = to alt0153?

Thanks

Charles
 

tamhas

ProgressTalk.com Sponsor
Alt0153 is the key combination for entering the code, not the code in the code page of the database. If your database is Unicode, then the code in the DB should be U+00AE ... I think.
 

Charles Givens

New Member
Thomas, long time no talk. I get that, the problem is it was loaded in the field with the TM and now I need to search and remove it.
 

tamhas

ProgressTalk.com Sponsor
And, what you need to search for will be determined by the code page of your database (and how you search may be influenced by the code page of your session). The ALT0153 is not a hex pattern that is stored in the database, but a keystroke pattern for entering that character. Once entered, it will be turned into the appropriate set of bytes for the code page you are using to store the information. So, the first thing we need to know is what is the code page of your database and what is the code page of the session in which the character was entered.

Note that you should be able to make a general purpose search tool that takes an input character and a character(s) to substitute and apply that to the field in question using the ALT0153 for the input. Or, if you can identify one record that has the character, you should be able to inspect it with a hex editor.
 

Charles Givens

New Member
Thomas,

The Codepage is the deafult iso8859-1. I just need to strip it out. I found some example code where it looks at the following:
DEFINE VARIABLE trademark AS CHARACTER NO-UNDO
INITIAL "(ä)".
DEFINE VARIABLE charsetstring AS CHARACTER NO-UNDO.

charsetstring = CODEPAGE-CONVERT(trademark, SESSION:CHARSET, "ibm850").

FOR EACH icsp NO-LOCK
where icsp.cono eq 20
and icsp.prod eq "BRACL517619":
IF LOOKUP(charsetstring, icsp.descrip3) > 0 THEN
DISPLAY icsp.prod.
END.

This return nothing, even though I know that record has a TM in it. Some of the data looks like:

"BRADYMARKER® I.D. PRO® SERIES PERMANENT POLYESTER LABELS - WHITE. BRAND NAME: B
RADY®. SUB BRAND: BRADYMARKER™ I.D. PRO® SERIES. TYP

Charles
 

tamhas

ProgressTalk.com Sponsor
8859-1 has no trademark symbol ... which might be contributing to your problem. I suggest you dump that record and look at what is in it with a hex editor.

I am also curious about what you are doing in that code. You initialize trademark as "(ä)". This is three valid characters in 8859-1 with hex values 28, E4, and 29. You then convert to ibm850. Why?

 

Cringer

ProgressTalk.com Moderator
Staff member
This is from the Chrome editor so not syntax checked, but it might help! Set myString to be one of the values with the TM in.
Code:
DO i = 1 to LENGTH(myString):
  DISPLAY SUBSTRING(myString,i,1) ASC(SUBSTRING(myString,i,1).
END.

That should give you the ASCII value of each character in the string. Then you can search for all strings with CHR(myResult).
 
Last edited:

RealHeavyDude

Well-Known Member
The charscan option to the proutil convchar can do that for you too.

The tool is intended to be used when you plan to change the code page of your database to find records with strings that may contain characters which are not supported by the target code page - to do something with them ...

Have a look:

 
Top