Search found 639 matches

by arcticir
25 Mar 2020, 09:59
Forum: 脚本函数
Topic: [v2] 简繁转换
Replies: 0
Views: 90

[v2] 简繁转换

注意 简繁并不完全对应。 繁转简,采用富集策略,存在 一对多 、多通假等状况。 简转繁,则追求简洁无错。 kanji(byref s,t:=""){ ; r= 1-简繁 ""-繁简 static fj,jf if t { if !jf jf:=kanji_jf() to:=jf } else { if !fj fj:=kanji_fj() to:=fj } Loop Parse,s st.=ObjRawGet(to,A_Loopfield) or A_Loopfield Return st } kanji_fj(){ t:={} loop parse,"丟丢並并乹乾亁乾亂乱亙亘亞亚佇伫併并來来...
by arcticir
05 Mar 2020, 07:47
Forum: AutoHotkey v2 Scripts and Functions
Topic: [H2] sci() - SciLexer Class
Replies: 0
Views: 498

[H2] sci() - SciLexer Class

Note: It applies to AHK_H V2 You need to specify the absolute path of dll. It inverts the A/B parameter, so from sci.settext(0,"test") to sci.settext("test") It lacks an error correction mechanism. Reference Forum Existing Lib gui:=GuiCreate("+Border -DPIScale",a_name) sci:=sci(gui.hwnd,w:=A_ScreenW...
by arcticir
05 Mar 2020, 07:13
Forum: AutoHotkey v2 Scripts and Functions
Topic: [H2] sq() - SQLite Class
Replies: 0
Views: 376

[H2] sq() - SQLite Class

Note: It applies to AHK_H V2(106+) You need to specify the absolute path of sqlite3. The sqlite3 function is called like this: sq.close[] Code from @HotKeyIt Simple example: sq:=sq(a_ahkdir "\test.db") sq.set("create table if not exists test (a,b,c);") sq.set("INSERT INTO test (a,b,c) VALUES(1,2,3);...
by arcticir
21 Feb 2020, 05:22
Forum: AutoHotkey_H
Topic: How to distinguish between many types of object?
Replies: 12
Views: 1193

Re: How to distinguish between many types of object?

It does not help judge the two:
obj.__Enum or obj.OwnProps()
by arcticir
18 Feb 2020, 10:15
Forum: AutoHotkey_H
Topic: How to distinguish between many types of object?
Replies: 12
Views: 1193

Re: How to distinguish between many types of object?

Struct does not have hasMethod, hasMethod("__Enum ") does not seem to be the perfect solution.
by arcticir
16 Feb 2020, 15:49
Forum: AutoHotkey_H
Topic: How to distinguish between many types of object?
Replies: 12
Views: 1193

Re: How to distinguish between many types of object?

Thank you. We should consider that the source of many classes is unknown.
by arcticir
16 Feb 2020, 12:20
Forum: AutoHotkey_H
Topic: How to distinguish between many types of object?
Replies: 12
Views: 1193

Re: How to distinguish between many types of object?

Code: Select all

MsgBox [].base.base.__Class ;Object
So you have no characteristics.

In fact, there is only one place I need to judge its exact type:
for k,v in obj ;--->> obj? or obj.OwnProps()?
by arcticir
16 Feb 2020, 09:40
Forum: AutoHotkey_H
Topic: function return Multiple values
Replies: 4
Views: 702

Re: function return Multiple values

Thanks. I think "do not break the current" is a pseudo-proposition, because most rules of V1 have been broken by V2.
v2 existing rules are subject to much criticism, are constantly changing, and there is no need to be conservative.
by arcticir
16 Feb 2020, 09:12
Forum: AutoHotkey_H
Topic: How to distinguish between many types of object?
Replies: 12
Views: 1193

Re: How to distinguish between many types of object?

such?

Code: Select all

Class test{
}
t:=test.new()
MsgBox Type(t) ;Class
MsgBox t.prototype.__Class ;test
by arcticir
16 Feb 2020, 08:16
Forum: AutoHotkey_H
Topic: How to distinguish between many types of object?
Replies: 12
Views: 1193

How to distinguish between many types of object?

Type () can be used to distinguish obj-map_arr, but I don't know how to classify some special objects, such as class. Does the class object have any characteristics that can be used to judge? for i,n in type(t)="object"?t.OwnProps():t The current solution is to create a list of all possible occurren...
by arcticir
16 Feb 2020, 08:05
Forum: AutoHotkey_H
Topic: function return Multiple values
Replies: 4
Views: 702

Re: function return Multiple values

Yes, it must be read and written multiple times. r:=t(),x:=t[1],y:=t[2] If you ask why t[1]t[2] is not used directly, obviously what is discussed here is how to return multiple values. ;) V2 has undergone tremendous changes, has many advantages, and is somewhat unacceptable. If the function supports...
by arcticir
15 Feb 2020, 06:53
Forum: AutoHotkey_H
Topic: function return Multiple values
Replies: 4
Views: 702

function return Multiple values

If you need the function to return multiple values. There are several ways: ByRef - t(ByRef a, ByRef b) Its disadvantage is that it cannot be nested t(ByRef a, ByRef b){ ;... if test t(i,n) } obj - t()=>[1,2] Its disadvantage is that it is too tedious, and value needs to be written multiple times. m...
by arcticir
14 Feb 2020, 04:26
Forum: AutoHotkey_H
Topic: Memory leak
Replies: 6
Views: 835

Re: Memory leak

Thank you. It seems that I mistakenly and stubbornly think that it is a local variable.
by arcticir
13 Feb 2020, 02:06
Forum: AutoHotkey_H
Topic: Memory leak
Replies: 6
Views: 835

Re: Memory leak

RegExMatch(fileread(A_LineFile),"s);\!(.*)",r) t:=ahkload() t.new("#Persistent`n#NoTrayIcon`nr:=object(" (&t) "),r.hwnd:=A_ScriptHwnd`ntt:=[1,2,3,4]`n`nreturn`n" r.1) t.DefineMethod('__Call', func("pin_call")) sleep 1000 loop 100000 { t2:=t.ahkgetvar("tt") } MsgBox type(t2) ahkload(){ UnZipRawMemor...
by arcticir
11 Feb 2020, 18:23
Forum: Ask For Help
Topic: func err
Replies: 2
Views: 199

Re: func err

Thank you. It seems that good naming conventions are very important.
by arcticir
11 Feb 2020, 18:06
Forum: AutoHotkey_H
Topic: Memory leak
Replies: 6
Views: 835

Re: Memory leak

The only possibility is that the dll thread did not load, or it did not load within 100 milliseconds. You can try changing it to "sleep 1000" ahkdll({code:"#Persistent`ntt:=[1,2,3,4]`nreturn`nMsgBox a_type ahktime(" ahktime() ")`nToolTip 1,1,1`nreturn"}) ------>sleep 100 th:=a_pin.1 or: ahkdll({code...
by arcticir
11 Feb 2020, 17:43
Forum: AutoHotkey_H
Topic: macro issues
Replies: 0
Views: 508

macro issues

In this example, scrolling the wheel multiple times in the GUI will cause an error. Removing "macro" will become normal. Exception was caused in thread id: 13616 Line: 20 Specifically: MouseGetPos(,,,hwnd,2) new_class("test") hwnd:=CreateWindowEx(,"test",,0X80000000|0X10000000,222,222,222,222) sleep...
by arcticir
11 Feb 2020, 12:58
Forum: Ask For Help
Topic: func err
Replies: 2
Views: 199

func err

Code: Select all

MsgBox % a()

f:=flux()

Code: Select all

Error:  Call to nonexistent function.

Specifically: a())

	Line#
--->	001: MsgBox(a())
	003: f := flux()

Code: Select all

flux(){   ;to lib file

}

a(){

}
by arcticir
11 Feb 2020, 09:51
Forum: AutoHotkey v2 Help
Topic: How to copy Method in v2?
Replies: 2
Views: 522

Re: How to copy Method in v2?

thank you. ;)

Go to advanced search