win10-64 h2-64
Code: Select all
flux()
Code: Select all
; to lib dir
flux(this:="",tag:="",list*){
static _f:=MsgBox(A_LineFile)
}
Code: Select all
flux()
Code: Select all
; to lib dir
flux(this:="",tag:="",list*){
static _f:=MsgBox(A_LineFile)
}
This would make it incompatible to other languages.arcticir wrote: ↑02 Feb 2020, 22:11I'm not sure which "object" you are talking about
ThreadObj.func("test","1") or ThreadObj.test(1) ;base.__call
But obviously both have big flaws.
So I use the example of passing data between processes in the "OnMessage ()" document, passing "ObjDump-objLoad" binary data between processes.
It can safely pass data between TLS-DLL-EXE, it can pass objects, return objects; it can make optional parameters take effect; it does not cause errors by passing 1 (instead of "1")
I usually use this custom function more, but I still hope that the built-in functions can achieve the same function with similar principles.
Code: Select all
fun(ahk,name,param*) => (sz:=ObjDump(param,v),ObjLoad(HexToBin(bin,ahk.ahkFunction("fun",name,BinToHex(&v,sz))))[1])
ahk:=AhkThread("
(
#Persistent
fun(name,param) => (sz:=ObjDump([%name%(ObjLoad(HexToBin(bin,param))*)],v), BinToHex(&v,sz))
myfunc(p*){
for k,v in p
MsgBox 'param count: ' p.Length '``nparameter ' k ' = ' v
return [1,2,3]
}
)")
for k,v in fun(ahk,"MyFunc","this","is", "a", "test", 1, 2, 3)
MsgBox "Returned object from function:`n" k "=" v
Code: Select all
func,param1-param9 => bin => send bin => bin => func,param1-param9
Code: Select all
objdump((func,param*),bin) => send bin => objLoad(bin) => func,param*
Code: Select all
ahk:=AhkThread("
(
#Persistent
myfuncp:=&myfunc:=Func('myfunc')
myfunc(p*){
for k,v in p
MsgBox 'param count: ' p.Length '``nparameter ' k ' = ' v
return [1,2,3]
}
)")
while !ahk.ahkgetvar("myfuncp")
Sleep 100
myfunc:=Object(ahk.ahkgetvar("myfuncp")+0)
for k, v in myfunc.Call("this","is","a","test",1,2,3)
MsgBox k "=" v
Code: Select all
fun(ahk,name,param*) => (sz:=ObjDump(param,v),ObjLoad(HexToBin(bin,ahk.ahkFunction("fun",name,BinToHex(&v,sz))))[1])
ahk:=AhkThread("
(
#Persistent
fun(name,param) => (sz:=ObjDump([%name%(ObjLoad(HexToBin(bin,param))*)],v), BinToHex(&v,sz))
myfunc(p*){
for k,v in p
MsgBox 'param count: ' p.Length '``nparameter ' k ' = ' v
return [1,2,3]
}
)")
for k,v in fun(ahk,"MyFunc","this","is", "a", "test", 1, 2, 3)
MsgBox "Returned object from function:`n" k "=" v
Users browsing this forum: No registered users and 50 guests