i cant help u further than that, but here are my findings:
1. Thread 1 and 2 the way theyre written in you original script exit immediately after the assignment, so Thread 3 wouldnt have had the chance to read the values even if it could do so correctly in the first place
2. Blue and 10am need to be escaped, else all youre doing is assigning the value of the variables Blue and 10am to Sky and Time, respectively
3. i couldnt for the life of me get ahkassign or alias to work. The only way was to retrieve the variable contents with ahkgetvar and pass them as command arguments to the newly created Thread3, which is just a janky workaround
Code: Select all
Thread1:=AhkThread("#Persistent`nSky := ""Blue""")
Thread2:=AhkThread("#Persistent`nTime := ""10am""")
Thread3:=AhkThread("
(
#Persistent
Msgbox % A_Args[1]
Msgbox % A_Args[2]
)", Thread1.ahkgetvar.Sky . " " . Thread2.ahkgetvar.Time)
Esc::ExitApp
here are my experiments:
Code: Select all
varAliasPending := 100 ; we'll be changing 'var' to this later on
Thread := AhkThread()
Thread.ahkassign("var", 50)
Thread.ahkExec("Msgbox % var") ; v1 works
; Thread.ahkExec("Msgbox(var)") ; v2 implodes, ACCESS_VIOLATION in line 4: ahkassign, why??
Alias(var, varAliasPending) ; time to change 'var' to equal 100
Thread.ahkExec("Msgbox % var") ; not working, 'var' still = 50
Alias(varAliasPending, var) ; maybe do it the other way around
Thread.ahkExec("Msgbox % var") ; not working, 'var' still = 50
Alias(var, getvar(varAliasPending)) ; ok, how about this
Thread.ahkExec("Msgbox % var") ; not working, 'var' still = 50
Alias(varAliasPending, getvar(var)) ; what even am i doing rn
Thread.ahkExec("Msgbox % var") ; not working, 'var' still = 50
maybe one of the 5 ppl on earth who understand ahk_h can shed some light