Errors from Documentation Topic is solved

Ask for help, how to use AHK_H, etc.
Posts: 18
Joined: 04 Feb 2016, 20:09

Errors from Documentation

01 May 2018, 19:07

I get errors, when pasting this code from the example documentation

Code: Select all

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

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.

Any advice would be appreciated. Thanks!
Posts: 1272
Joined: 11 Jan 2017, 17:59

Re: Errors from Documentation  Topic is solved

01 May 2018, 19:49

which ahk_h version are u using? there is no % to force expressions in v2
Posts: 18
Joined: 04 Feb 2016, 20:09

Re: Errors from Documentation

01 May 2018, 21:22

Im using version 2. Thanks for that response! You solved my problem. I'll use version 1 instead. =)

Return to “Ask For Help”

Who is online

Users browsing this forum: No registered users and 2 guests