Focal Point
[SOLVED] Checking for non-english comments

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5717041326

August 13, 2012, 01:25 PM
gjk
[SOLVED] Checking for non-english comments
I have a modify procedure that allows users to enter comments, in both Chinese and English. I need to make sure that the english comments contain no Chinese characters.

I have this validate in the procedure:

-* check for shift-in
WD01_V/A68 = UFMT(XDESCRIPT, 68, WD01_V);
SISO1/I3 = POSIT(WD01_V,68,'0E', 2, SISO1);

-* check for shift-out
WD01_V/A68 = UFMT(XDESCRIPT, 68, WD01_V);
SISO2/I3 = POSIT(WD01_V,68,'0F', 2, SISO2);

When I type english characters (E LINE 1), it translates to hex:
C540D3C9D5C540F14040404040404040404040404040404040404040404040404040

Within in this HEX character string the POSIT sub-routine finds the characters '0F', however this in not really the "shift-out" representation, it's just part of the string because of the line I typed (E LINE 1).

I could check each individual character, however I wanted to know if there is a better way to do this?

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6.4
August 13, 2012, 02:07 PM
Dan Satchell
Would the PATTERN function help?


WebFOCUS 7.7.05
August 17, 2012, 11:02 AM
Kerry
FYI, the issue is resolved: I created a routine to extract each byte from the comment and then converted that byte to Hexadecimal using the UFMT sub-routine. I then checked for the shift-in/shift out characters (0E and 0F).

Thanks gjk for sharing the info with all.

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.