cancel
Showing results for 
Search instead for 
Did you mean: 

how to check that field string is ascii<128

Former Member
0 Kudos

I have problem.

Is possible to check that FIELD that string is "ABC" or "non-ABC"

"ABC" mean is "A-Z", "a-z" , "0-9", "~`!@#$%&*()_+|{}:"<>?,./;'[]\"

Ascii < 128

Originally 128 first characters were defined in a character set known as ASCII.

"non-ABC" is out of this ,

Ascii > 128

I check ChrW(), that formula can help me?


Pseudo Code:

if {product.prodname} ascii < 128
"english name" & product.prodname
else
"non-english name. chinese name, japan name." & product.prodname

Any example please!

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

many thanks

Former Member
0 Kudos

Thanks, is fine. Now my new problem is

Modifying a text object.

Using Format Painter to change font styles.

dynamic font styles

Last topic: is

Format Editor

:Font:

Font: Arial x+2

http://www.scientificcomputing.com/images/0602/sc62OLS_fig1_lrg.jpg

But, would you mind to tell me,

In

Format Editor

:Font:

Font: Arial x+2

click x+2

formula. font name

enter this code, but no success work?



//stringvar x := 'Su03BCanjay';

stringvar x := {JOSX.T_SOURCE};

stringvar y := '';
numbervar i;
 
for i := 1 to length(x) do
(
if asc(x<i>) > 128 then 
(
y := "non-english name. chinese name, japan name. " & x;

//chinese font
//http://zh.wikipedia.org/wiki/%E7%B4%B0%E6%98%8E%E9%AB%94
"MingLiU";  

i := length(x) + 2;
exit for;
));
 
if i = length(x) + 1 then 
y := "english name. " & x;
"Courier New";
y;


Former Member
0 Kudos

You cannot simply check to see if the whole string is less than ascii 128, you will have to loop through the entire string. Here is an example"


stringvar x := 'Sµanjay';
stringvar y := '';
numbervar i;

for i := 1 to length(x) do
(
if asc(x<i>) > 128 then 
(
y := "non-english name. chinese name, japan name. " & x;
i := length(x) + 2;
exit for;
));

if i = length(x) + 1 then 
y := "english name. " & x;

y;

If you replace X with "Sanjay" then you will get the other result since all characters are under 128