Casting a int to a char

Unanswered Question
Apr 30th, 2007

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

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Fabio Funaki Fri, 05/04/2007 - 12:55

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

Actions

This Discussion