Jump to content

Non-english send func (UDF)


thesnow
 Share

Recommended Posts

#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 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

#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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...