>close databases all >create table test (f1 i, f2 m) >copy to test2 && as 1251 && uncomment to create the problem. >use in test >use test2 > >* encrypts >x=asc('+') >y=0 >for bit=7 to 0 step -1 > if x>((2^bit)-1) > x=x-(2^bit) > y=y+(2^(7-bit)) > endif >endfor >insert into test2 (f2) values (chr(y)) && stores the encrypted value to the memo. > >* decrypts >x=asc(f2) >y=0 >for bit=7 to 0 step -1 > if x>((2^bit)-1) > x=x-(2^bit) > y=y+(2^(7-bit)) > endif >endfor >?chr(y) >