根据输入的字符返回asc码,或者根据asc码返回字符
- REPORTztestljc.
- DATA:chrVALUE'C'.
- DATA:ascTYPEi.
- PERFORMgetascUSINGchr
- CHANGINGasc.
- WRITEasc.
- asc=65.
- performgetChrusingasc
- changingchr.
- writechr.
- *&---------------------------------------------------------------------*
- *&FormgetASC
- *&---------------------------------------------------------------------*
- *获得字符的ASC
- *----------------------------------------------------------------------*
- *-->P_C字符
- *-->P_ASCasc码
- *----------------------------------------------------------------------*
- FORMgetascUSINGp_c
- CHANGINGp_ascTYPEi.
- FIELD-SYMBOLS:<n>TYPEx.
- DATA:l_rn1TYPEi.
- ASSIGNp_cTO<n>CASTING.
- MOVE<n>TOl_rn1.
- p_asc=l_rn1/256.
- ENDFORM."getASC
- *&---------------------------------------------------------------------*
- *&FormgetChr
- *&---------------------------------------------------------------------*
- *获得ASC对应的字符
- *----------------------------------------------------------------------*
- *-->P_ASCasc码
- *-->P_C字符
- *----------------------------------------------------------------------*
- formgetchrusingp_asctypei
- changingp_ctypec.
- DATA:l_char(2).
- DATA:l_intTYPEi.
- DATA:x(4)TYPEx.
- FIELD-SYMBOLS:<fc>TYPEc.
- l_int=p_asc*256.
- MOVEl_intTOx.
- ASSIGNxTO<fc>CASTINGTYPEc.
- MOVE<fc>TOl_char.
- p_c=l_char+1.
- ENDFORM."getchr