thesnow Posted July 27, 2007 Share Posted July 27, 2007 (edited) expandcollapse popup#include-once ;====================================================== ; ; Func name: SendX("string",flag) ; Description: Send non-english string. ; $string: $string ,you text ; $flag: 0 ClipPut mode,1 send ASC mode ; Return Value : none ; Author: thesnow(rundll32@126.com) ; web: www.autoit.net.cn ; ;====================================================== Func SendX($string,$flag) Local $char Local $code Local $Clip if $flag <> 1 then $flag=0 Switch $flag Case 0 $clup=ClipGet() ClipPut($string) Send("+{ins}") ClipPut($clup) Case 1 For $i = 1 to StringLen($string) $char = StringMid($string, $i, 1) $code = Asc($char) If $code > 127 Then $code = $code * 256 $i = $i + 1 $char = StringMid($string, $i, 1) $code = $code + Asc($char) EndIf Send("{ASC " & $code & "}") Next EndSwitch EndFunc ;==>SendX Edited July 27, 2007 by thesnow Yes,it's me.thesnoW :idiot: .welcome to my au3 websiteit's a Chinese forum.http://www.AutoitX.com---------------------- Link to comment Share on other sites More sharing options...
martin Posted July 27, 2007 Share Posted July 27, 2007 expandcollapse popup#include-once ;====================================================== ; ; Func name: SendX("string",flag) ; Description: Send non-english string. ; $string: $string ,you text ; $flag: 0 ClipPut mode,1 send ASC mode ; Return Value : none ; Author: thesnow(rundll32@126.com) ; web: www.autoit.net.cn ; ;====================================================== Func SendX($string,$flag) Local $char Local $code Local $Clip if $flag <> 1 then $flag=0 Switch $flag Case 0 $clup=ClipGet() ClipPut($string) Send("+{ins}") ClipPut($clup) Case 1 For $i = 1 to StringLen($string) $char = StringMid($string, $i, 1) $code = Asc($char) If $code > 127 Then $code = $code * 256 $i = $i + 1 $char = StringMid($string, $i, 1) $code = $code + Asc($char) EndIf Send("{ASC " & $code & "}") Next EndSwitch EndFunc;==>SendX Does this really work? How do you know what the encoding is, or why should you assume that if a character code is greater than 127 you should send 256*code+nextcode? Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
thesnow Posted July 28, 2007 Author Share Posted July 28, 2007 Does this really work? How do you know what the encoding is, or why should you assume that if a character code is greater than 127 you should send 256*code+nextcode?127 Is Chinese used ,if $string is other language,please use sendx($string,0) Yes,it's me.thesnoW :idiot: .welcome to my au3 websiteit's a Chinese forum.http://www.AutoitX.com---------------------- Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now