/**/ signal on novalue /* force REXX and its way of 'NOVALUE ON' */ /* Usage: [MACRO] CHCP [codepage] */ /* Example: CHCP 1004 */ /* Example: NOMSG CHCP 850 */ /* Purpose: Optionally set codepage, return actual codepage */ /* Requires: Kedit 5.0 and OS/2 REXX (Frank Ellermann, 2006) */ if datatype( arg( 1 ), 'w' ) then call UTIL 'SysSetProcessCodePage', arg( 1 ) CP = UTIL( 'SysQueryProcessCodePage' ) address CMD '@CHCP' CP /* inform shell about CHCP (odd) */ if arg( 1 ) = CP | arg( 1 ) = '' then say 'CHCP' CP else 'emsg CHCP' CP exit CP UTIL: procedure /* load necessary RexxUtil entry */ if RxFuncQuery( arg( 1 )) then if RxFuncAdd( arg( 1 ), 'RexxUtil', arg( 1 )) then do "emsg can't add RexxUtil" arg( 1 ) ; exit -3 end interpret 'return' arg( 1 ) || '(' arg( 2 ) || ')'