Page 1 of 1

Errors from Documentation

Posted: 01 May 2018, 19:07
by Galaxis
I get errors, when pasting this code from the example documentation

Code: Select all

NewThread("Msgbox `% variable:=`"Thread`"")
Image

The following code from the documentation does not show a message in the Message box. I just want to get a general idea of how multithreading works. I just switched to AHK_H a few days ago, simply for its multithreading. But there are errors left and right, when I copy/paste examples from the documentation.

Code: Select all

Command  Example: NewThread "MsgBox Message from thread."   
Function Example: ThreadID := NewThread("MsgBox Message from thread.")

The message boxes are emtpy. No text

Code: Select all

ahkdll:=AhkThread("Msgbox `% variable:=`"Thread`"") ; Loads the AutoHotkey module and starts the script.
While !ahkdll.ahkgetvar.variable
  Sleep 50 ; wait until variable has been set.
MsgBox % ahkdll.ahkgetvar.variable ; Display content of variable in thread
ahkthread_free(ahkdll),ahkdll:="" ; Stop execution in thread and free resources.
Image

Any advice would be appreciated. Thanks!

Re: Errors from Documentation  Topic is solved

Posted: 01 May 2018, 19:49
by swagfag
which ahk_h version are u using? there is no % to force expressions in v2

Re: Errors from Documentation

Posted: 01 May 2018, 21:22
by Galaxis
Swagfag,
Im using version 2. Thanks for that response! You solved my problem. I'll use version 1 instead. =)