Get character code as int
Posted in 2011
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
Working on % fglpc -v IBM INFORMIX-4GL Version 7.32.UC1 Pcode Version 732 I'm trying to get the ascii integer code for a character like this define i int define c char display "--> ",ascii 65 let c = 'A' let i = c display "--> ",i Outout: --> A --> How can i get the ascii code value into an integer var. ?
You want the ORD() function: LET i = ORD(c) Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Mon, Sep 19, 2011 at 9:26 AM, PETER MüLLER <si@coemter.com> wrote: > Working on > % fglpc -v > IBM INFORMIX-4GL Version 7.32.UC1 > Pcode Version 732 > > I'm trying to get the ascii integer code for a character like this > > define i int > define c char > > display "--> ",ascii 65 > let c = 'A' > let i = c > display "--> ",i > > Outout: > > --> A > --> > > How can i get the ascii code value into an integer var. ? > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --20cf303639b3fef7f104ad4fd494
That was exactly that i was lookig for. Thank you !