cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
615
Views
0
Helpful
1
Replies

Casting a int to a char

sferland
Level 1
Level 1

Hey Guys,

I need to reproduce an encryption algorithm originaly created in a Oracle Stored Procedure, into a CRS script.

Two of the steps of this algorithm are using functions ASCII() and CHR().

ASCII() = Returns the NUMBER code that represents the specified character.

CHR() = Returns the character associated with the specified NUMBER code.

Each of these two functions are the inverse of the other.

In CRS, Java is the programming language. So, for the ASCII function, I was able to recreate this function by just casting a "char" variable to a "int" variable via the SET step.

Ex: SET temp_int = temp_char

So, for the CHR function, I tried to cast a "int" variable to a "char". But unfortunately for me, the inverse cast is not permit by the CRS editor.

Ex: SET temp_char = temp_int ----> error : expecting a char instead of a int.

Any thought ???

Steven

1 Reply 1

Fabio Funaki
Level 1
Level 1

Steven,

I don't have an CRS system to test now, but I think that this must work:

SET temp_char = (char) temp_int

HTH

Fabio