Errors from Documentation Topic is solved

Ask for help, how to use AHK_H, etc.
Galaxis
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] [Download] GeSHi © Codebox Plus

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] [Download] GeSHi © Codebox Plus

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] [Download] GeSHi © Codebox Plus

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!
swagfag
Posts: 937
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
Galaxis
Posts: 18
Joined: 04 Feb 2016, 20:09

Re: Errors from Documentation

01 May 2018, 21:22

Swagfag,
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 1 guest