字符转换工具,仿牛族字符转换

2011061411054869.jpg
 
  
;没有设置错误陷阱,仿牛族字符转换.因为牛族老是被金山灭掉,所以就自己仿了个.功能简单只是Ascii与char的互转而已.
;
#Region **** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_OutFile
= 字符转换.exe
#AutoIt3Wrapper_Run_Tidy
= y
#EndRegion ;
**** 参数创建于 ACNWrapper_GUI ****
#include
< ButtonConstants.au3 >
#include
< EditConstants.au3 >
#include
< GUIConstantsEx.au3 >
#include
< WindowsConstants.au3 >
#include
< GuiEdit.au3 >
#include
< array.au3 >


#Region ### START Koda GUI section ### Form=d:\程\字符转换\字符转换.kxf
$Form1_1
= GUICreate( " 字符转换 " , 623 , 538 , 192 , 114 , BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_THICKFRAME))
$Edit1
= GUICtrlCreateEdit( "" , 8 , 8 , 601 , 225 );ID = 3
;GUICtrlSetData(
- 1 , " Edit1 " )
$Button1
= GUICtrlCreateButton( " Ascii to Char ↓ " , 88 , 248 , 113 , 41 , $BS_MULTILINE);ID = 4
$Edit2
= GUICtrlCreateEdit( "" , 8 , 304 , 601 , 225 );ID = 5
;GUICtrlSetData(
- 1 , " Edit2 " )
$Button2
= GUICtrlCreateButton( " 清空 " , 368 , 248 , 105 , 41 );ID = 6
$Button4
= GUICtrlCreateButton( " 退出 " , 504 , 248 , 105 , 41 );ID = 7
$Button3
= GUICtrlCreateButton( " Char to Ascii ↑ " , 224 , 248 , 113 , 41 );ID = 8
$Label1
= GUICtrlCreateLabel( " 分隔符: " , 24 , 248 , 43 , 17 );ID = 9
$Input1
= GUICtrlCreateInput( "" , 16 , 264 , 57 , 21 );ID = 10 分隔符
GUISetState(@SW_SHOW)
#EndRegion ###
END Koda GUI section ###

While 1
$nMsg
= GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

Case $Button1;Ascii to Char

$NumOfLine
= "" ;存储输入的数据
$
string = "" ;输出
$splitflag
= GUICtrlRead( 10 , 0 )

For $x = 0 To _GUICtrlEdit_GetLineCount( 3 ) - 1
$NumOfLine
= _GUICtrlEdit_GetLine( 3 , $x)
$array
= StringSplit($NumOfLine, $splitflag, 1 );此时$NumOfLine[ 0 ] = 数组元素的总数,
_ArrayDelete($array,
0 );所以用_ArrayDelete函数将$NumOfLine[ 0 ]的值删除
_ArrayAdd($array,
" 13 " ) ;为实现换行,添加一个换行符至$array数组末尾.

For $a In $array
If $a <> "" Then
If $a <> " 13 " Then
$
string = $ string & Chr ($a)
Else
$
string = $ string & @CRLF
EndIf
EndIf
GUICtrlSetData(
5 , $ string )
Next
Next

Case $Button2;清空
GUICtrlSetData(
3 , "" )
GUICtrlSetData(
5 , "" )
GUICtrlSetData(
10 , "" )
Case $Button3; Char to Ascii

$
string = ""
$NumOfLine
= ""

For $x = 0 To _GUICtrlEdit_GetLineCount( 5 )

$NumOfLine
= StringStripWS(StringStripCR(_GUICtrlEdit_GetLine( 5 , $x)), 8 )

For $a = 1 To StringLen($NumOfLine)
$
string = $ string & Asc (StringMid($NumOfLine, $a)) & " "
Next
$
string = $ string & @CRLF
GUICtrlSetData(
3 , $ string )
Next
Case $Button4;退出
Exit
EndSwitch
WEnd

转载于:https://www.cnblogs.com/jhcla/archive/2011/06/10/2077233.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值