判別中英文及數字
DATA: hex_word(1) TYPE x VALUE 'A1'.
FIELD-SYMBOLS: <l_hex> TYPE x.
ASSIGN sekey(1) TO <l_hex> CASTING.
IF <l_hex> >= hex_word.
WRITE: ‘中文’..
ELSE.
WRITE: ‘英文數字’.
endif.
判別數字跟非數字
DATA str_tmp TYPE string .
DATA: STR(10).
STR = '123'.
str_tmp = str.
IF NOT str_tmp CO '0123456789.-'.
WRITE / 'Err'. “字串
ELSE.
WRITE / STR. “數字
ENDIF.
全站熱搜
留言列表