ENVI &&SLASH2=//
ENVI$ &&NL=0d 0a
ENVI &&SRC=HELP0.TXT

_SUB  XXX
CODE  -GBK,HELP0.TXT,-BIG5,HELPBIG5.TXT
WRIT HELPBIG5.TXT,$1,#code=950     %&SLASH2%GBK=936  BIG5=950  ASCII=0(default)
CMPS -m HELPBIG5.TXT  HELPBIG5.CMZ

CODE -BIG5,HELPBIG5.TXT,-UNICODE,HELPBIG5U.TXT
WRIT HELPBIG5U.TXT,$1,#code=950     %&SLASH2%GBK=936  BIG5=950  ASCII=0(default)
CMPS -m HELPBIG5U.TXT  HELPBIG5U.CMZ

CODE *transonly  -GBK,HELP0.TXT,-BIG5,HELPBIG5_936.TXT    //GBK 繁体； 能用；但BIG5系统上 不能直接编辑； 
CMPS -m HELPBIG5_936.TXT  HELPBIG5_936.CMZ

CODE -GBK,HELPBIG5_936.TXT,-UNICODE,HELPBIG5_936U.TXT     //UNICODE 繁体； 能用；这样BIG5系统上 能直接编辑； 
WRIT HELPBIG5_936U.TXT,1,#code=936     %&SLASH2%GBK=936  BIG5=950  ASCII=0(default)  

//编辑完了,转成GBK
CODE -UNICODE,HELPBIG5_936U.TXT,-GBK,HELPBIG5_936_2.TXT   //GBK 繁体； 能用
CMPS -m HELPBIG5_936_2.TXT  HELPBIG5_936_2.CMZ


_END


_SUB  T1_UNICODE
FIND $* = %1,!  ENVI @L=
ENVI  &&SRC=HELP0.TXT
IFEX  HELPGBK.CMZ, TEAM CMPS -u HELPGBK.CMZ  HELPGBK.TXT|  ENVI &SRC=HELPGBK.TXT
IFEX  Resource\HELP0.TXT, ENVI &SRC=Resource\HELP0.TXT
 
CODE *transonly  -GBK,%&SRC%,-BIG5,HELPBIG5_936.TXT    //GBK 繁体； 能用；但BIG5系统上 不能直接编辑； 
    WAIT 50
CMPS -m HELPBIG5_936.TXT  HELPBIG5_936.CMZ
    WAIT 50

CODE -GBK,HELPBIG5_936.TXT,-UNICODE,HELPBIG5_936U.TXT     //UNICODE 繁体； 能用；这样BIG5系统上 能直接编辑； 
    WAIT 50
WRIT HELPBIG5_936U.TXT,$1,#code=936     %&SLASH2%GBK=936  BIG5=950  ASCII=0(default)  
    WAIT 100

FIND $* = %1,!  ENVI @L=已转换成 HELPBIG5_936.CMZ 和  \nHELPBIG5_936U.TXT
_END


_SUB T2_EDIT_UNICODE_TH
    TEAM ENVI @B1.Enable=0|  ENVI @B2.Enable=0|  ENVI @B3.Enable=0|  ENVI @BA.Enable=0| WAIT 500
    //FIND $1=%BEDIT.Check%,  
        TEAM EXEC =NOTEPAD  HELPBIG5_936U.TXT| WAIT 200  
    TEAM ENVI @B1.Enable=1|  ENVI @B2.Enable=1|  ENVI @B3.Enable=1|  ENVI @BA.Enable=1
_END

_SUB T2_EDIT_UNICODE
    ENVI @L=正在编辑 HELPBIG5_936U.TXT
    THREAD* CALL  T2_EDIT_UNICODE_TH
_END


_SUB T3_NEBU
    FIND $* = %1,!  ENVI @L=
    CODE -UNICODE,HELPBIG5_936U.TXT,-GBK,HELPBIG5_936_2.TXT   //GBK 繁体； 能用
    WRIT HELPBIG5_936_2.TXT,$1,#code=936     %&SLASH2%GBK=936  BIG5=950  ASCII=0(default)  
    CMPS -m HELPBIG5_936_2.TXT  HELPBIG5_936_2.CMZ
    FIND $* = %1,!  ENVI @L=已转换成 HELPBIG5_936_2.CMZ , \n可以替换PECMD2012\RCDATA\301\2052    
_END


_SUB T123
    TEAM ENVI @B1.Enable=0|  ENVI @B2.Enable=0|  ENVI @B3.Enable=0|  ENVI @BA.Enable=0
    TEAM CALL  T1_UNICODE|  CALL  T2_EDIT_UNICODE_TH| CALL  T3_NEBU
    TEAM FILE HELPBIG5_936.CMZ|  FILE HELPBIG5_936.TXT|  FILE  HELPBIG5_936.CMZ
    TEAM FILE HELPBIG5_936_2.TXT|  FILE HELPBIG5_936_2.TXT| FILE HELPBIG5_936U.TXT
    TEAM ENVI @B1.Enable=1|  ENVI @B2.Enable=1|  ENVI @B3.Enable=1|  ENVI @BA.Enable=1
_END


_SUB  WIN1,W420H290,PECMD转繁体
    ITEM  BA,L150T110W120H20,全部          ,  THREAD*  CALL  T123

    ITEM  B1,L150T020W120H20,1.转可编辑繁体,  CALL  T1_UNICODE
    ITEM  B2,L150T050W120H20,2.编辑        ,  CALL  T2_EDIT_UNICODE
    ITEM  B3,L150T080W120H20,3.转内部繁体  ,  CALL  T3_NEBU
    
//    LABE L,L50T150W220H50,
//  MEMO L,L50T150W320H50,,,2
    NAME -ext  &&name=%&CurFile%
    ENVI &&MSG=LOAD %&name%   -a \n可以直接转换   
    EDIT-| L,L50T150W320H90,%&MSG%,,6
//    CHEK BEDIT,L279T106W77H30,编辑修改,,
_END
_SUB AUTO123
    TEAM CALL  T1_UNICODE *| WAIT 500
    //TEAM EXEC =NOTEPAD  HELPBIG5_936U.TXT| WAIT 200  
    CALL  T3_NEBU *
    TEAM FILE HELPBIG5_936.CMZ|  FILE HELPBIG5_936.TXT|  FILE  HELPBIG5_936.CMZ
    TEAM FILE HELPBIG5_936_2.TXT|  FILE HELPBIG5_936_2.TXT| FILE HELPBIG5_936U.TXT
_END 
FIND $-a = %1,  CALL AUTO123! CALL WIN1
