<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Functions cannot contain functions]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=14436</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14436&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Functions cannot contain functions».]]></description>
		<lastBuildDate>Sun, 23 Dec 2018 18:19:52 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Functions cannot contain functions]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=130547#p130547</link>
			<description><![CDATA[<p>Решилась проблема. Дело в том, что в основном скрипте этот инклуд не единственный. Он был второй по порядку, а в последней функции первого инклуда не была закрыта скобка, в следствии чего интерпретатор думал, что весь второй инклуд это часть последней функции первого инклуда. Остается загадкой, как все это дело работало год назад, или может я что напутал, ну да черт с ним.</p>]]></description>
			<author><![CDATA[null@example.com (belyankin12)]]></author>
			<pubDate>Sun, 23 Dec 2018 18:19:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=130547#p130547</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Functions cannot contain functions]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=130546#p130546</link>
			<description><![CDATA[<p>АХК установлен в ANSI изначально.</p>]]></description>
			<author><![CDATA[null@example.com (belyankin12)]]></author>
			<pubDate>Sun, 23 Dec 2018 17:45:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=130546#p130546</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Functions cannot contain functions]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=130545#p130545</link>
			<description><![CDATA[<p><strong>belyankin12</strong>, мб АХК в ANSI поможет?</p>]]></description>
			<author><![CDATA[null@example.com (Phoenixxx_Czar)]]></author>
			<pubDate>Sun, 23 Dec 2018 17:42:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=130545#p130545</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Functions cannot contain functions]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=130544#p130544</link>
			<description><![CDATA[<p>Здравствуйте, уважаемые программисты. Год назад использовал некоторый набор скриптов, после чего взял перерыв на год, а сейчас решил вернуться к своей деятельности. Все скрипты были забэкапены в облаке, откуда были скачаны сейчас (т.е. код скриптов никак не поменялся). Проблема следующая: при попытке запустить скрипт, выдается ошибка в скрипте, который инклудится в основной скрипт: &quot;Functions cannot contain functions.&quot; (напомню что этот скрипт работал ранее). При попытке отключить проблемную функцию, ошибка вылезала на следующей функции, потом на следующей и так далее. При попытке закомментировать все внутри проблемной функции ошибка не исчезала. Прикрепляю код проблемного скрипта. Так как код не менялся, значит проблемы вызывает среда, в которой код исполняется. Виндоувс был переустановлен, но с той же флешки, что и ранее. Если и вправду проблема не в коде, тогда возникает вопрос: что вызывает такую ошибку? Возможно я прозевал какую-то библиотеку и не установил её, возможно версия AHK поменялась и правила у функций тоже (установил AHK&nbsp; 1.4 с сайта). Может кто-нибудь подсказать в чем может быть проблема? Код скрипта:<br /></p><div class="codebox"><pre><code>#NoEnv 

PATH_OVERLAY := RelToAbs(A_ScriptDir, &quot;\Cache\dx9_overlay.dll&quot;)

hModule := DllCall(&quot;LoadLibrary&quot;, Str, PATH_OVERLAY)
if(hModule == -1 || hModule == 0)
{
	MsgBox, 48, Error, The dll-file couldn&#039;t be loaded!
	ExitApp
}


Init_func 				:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;Init&quot;)
SetParam_func 			:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;SetParam&quot;)

TextCreate_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;TextCreate&quot;)
TextDestroy_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;TextDestroy&quot;)
TextSetShadow_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;TextSetShadow&quot;)
TextSetShown_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;TextSetShown&quot;)
TextSetColor_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;TextSetColor&quot;)
TextSetPos_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;TextSetPos&quot;)
TextSetString_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;TextSetString&quot;)
TextUpdate_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;TextUpdate&quot;)

BoxCreate_func 			:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;BoxCreate&quot;)
BoxDestroy_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;BoxDestroy&quot;)
BoxSetShown_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;BoxSetShown&quot;)
BoxSetBorder_func		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;BoxSetBorder&quot;)
BoxSetBorderColor_func 	:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;BoxSetBorderColor&quot;)
BoxSetColor_func		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;BoxSetColor&quot;)
BoxSetHeight_func		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;BoxSetHeight&quot;)
BoxSetPos_func			:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;BoxSetPos&quot;)
BoxSetWidth_func		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;BoxSetWidth&quot;)

LineCreate_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;LineCreate&quot;)
LineDestroy_func		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;LineDestroy&quot;)
LineSetShown_func		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;LineSetShown&quot;)
LineSetColor_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;LineSetColor&quot;)
LineSetWidth_func		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;LineSetWidth&quot;)
LineSetPos_func			:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;LineSetPos&quot;)

ImageCreate_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;ImageCreate&quot;)
ImageDestroy_func		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;ImageDestroy&quot;)
ImageSetShown_func		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;ImageSetShown&quot;)
ImageSetAlign_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;ImageSetAlign&quot;)
ImageSetPos_func		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;ImageSetPos&quot;)
ImageSetRotation_func	:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;ImageSetRotation&quot;)

DestroyAllVisual_func	:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;DestroyAllVisual&quot;)
ShowAllVisual_func		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;ShowAllVisual&quot;)
HideAllVisual_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;HideAllVisual&quot;)

GetFrameRate_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;GetFrameRate&quot;)
GetScreenSpecs_func 	:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;GetScreenSpecs&quot;)

SetCalculationRatio_func:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;SetCalculationRatio&quot;)

SetOverlayPriority_func := DllCall(&quot;GetProcAddress&quot;, UInt, hModule, Str, &quot;SetOverlayPriority&quot;)

Init()
{
	global Init_func
	res := DllCall(Init_func)
	return res
}

SetParam(str_Name, str_Value)
{
	global SetParam_func
	res := DllCall(SetParam_func, Str, str_Name, Str, str_Value)
	return res
}

TextCreate(Font, fontsize, bold, italic, x, y, color, text, shadow, show)
{
	global TextCreate_func
	res := DllCall(TextCreate_func,Str,Font,Int,fontsize,UChar,bold,UChar,italic,Int,x,Int,y,UInt,color,Str,text,UChar,shadow,UChar,show)
	return res
}

TextDestroy(id)
{
	global TextDestroy_func
	res := DllCall(TextDestroy_func,Int,id)
	return res
}

TextSetShadow(id, shadow)
{
	global TextSetShadow_func
	res := DllCall(TextSetShadow_func,Int,id,UChar,shadow)
	return res
}

TextSetShown(id, show)
{
	global TextSetShown_func
	res := DllCall(TextSetShown_func,Int,id,UChar,show)
	return res
}

TextSetColor(id,color)
{
	global TextSetColor_func
	res := DllCall(TextSetColor_func,Int,id,UInt,color)
	return res
}

TextSetPos(id,x,y)
{
	global TextSetPos_func
	res := DllCall(TextSetPos_func,Int,id,Int,x,Int,y)
	return res
}

TextSetString(id,Text)
{
	global TextSetString_func
	res := DllCall(TextSetString_func,Int,id,Str,Text)
	return res
}

TextUpdate(id,Font,Fontsize,bold,italic)
{
	global TextUpdate_func
	res := DllCall(TextUpdate_func,Int,id,Str,Font,int,Fontsize,UChar,bold,UChar,italic)
	return res
}

BoxCreate(x,y,width,height,Color,show)
{
	global BoxCreate_func
	res := DllCall(BoxCreate_func,Int,x,Int,y,Int,width,Int,height,UInt,Color,UChar,show)
	return res
}

BoxDestroy(id)
{
	global BoxDestroy_func
	res := DllCall(BoxDestroy_func,Int,id)
	return res
}

BoxSetShown(id,Show)
{
	global BoxSetShown_func 
	res := DllCall(BoxSetShown_func,Int,id,UChar,Show)
	return res
}
	
BoxSetBorder(id,height,Show)
{
	global BoxSetBorder_func
	res := DllCall(BoxSetBorder_func,Int,id,Int,height,Int,Show)
	return res
}


BoxSetBorderColor(id,Color)
{
	global BoxSetBorderColor_func 
	res := DllCall(BoxSetBorderColor_func,Int,id,UInt,Color)
	return res
}

BoxSetColor(id,Color)
{
	global BoxSetColor_func
	res := DllCall(BoxSetColor_func,Int,id,UInt,Color)
	return res
}

BoxSetHeight(id,height)
{
	global BoxSetHeight_func
	res := DllCall(BoxSetHeight_func,Int,id,Int,height)
	return res
}

BoxSetPos(id,x,y)
{
	global BoxSetPos_func	
	res := DllCall(BoxSetPos_func,Int,id,Int,x,Int,y)
	return res
}

BoxSetWidth(id,width)
{
	global BoxSetWidth_func
	res := DllCall(BoxSetWidth_func,Int,id,Int,width)
	return res
}

LineCreate(x1,y1,x2,y2,width,color,show)
{
	global LineCreate_func
	res := DllCall(LineCreate_func,Int,x1,Int,y1,Int,x2,Int,y2,Int,Width,UInt,color,UChar,show)
	return res
}

LineDestroy(id)
{
	global LineDestroy_func
	res := DllCall(LineDestroy_func,Int,id)
	return res
}

LineSetShown(id,show)
{
	global LineSetShown_func
	res := DllCall(LineSetShown_func,Int,id,UChar,show)
	return res
}

LineSetColor(id,color)
{
	global LineSetColor_func
	res := DllCall(LineSetColor_func,Int,id,UInt,color)
	return res
}

LineSetWidth(id, width)
{
	global LineSetWidth_func
	res := DllCall(LineSetWidth_func,Int,id,Int,width)
	return res
}

LineSetPos(id,x1,y1,x2,y2)
{
	global LineSetPos_func
	res := DllCall(LineSetPos_func,Int,id,Int,x1,Int,y1,Int,x2,Int,y2)
	return res
}

ImageCreate(path, x, y, rotation, align, show)
{
	global ImageCreate_func
	res := DllCall(ImageCreate_func, Str, path, Int, x, Int, y, Int, rotation, Int, align, UChar, show)
	return res
}

ImageDestroy(id)
{
	global ImageDestroy_func
	res := DllCall(ImageDestroy_func,Int,id)
	return res
}

ImageSetShown(id,show)
{
	global ImageSetShown_func
	res := DllCall(ImageSetShown_func,Int,id,UChar,show)
	return res
}

ImageSetAlign(id,align)
{
	global ImageSetAlign_func
	res := DllCall(ImageSetAlign_func,Int,id,Int,align)
	return res
}

ImageSetPos(id, x, y)
{
	global ImageSetPos_func
	res := DllCall(ImageSetPos_func,Int,id,Int,x, Int, y)
	return res
}

ImageSetRotation(id, rotation)
{
	global ImageSetRotation_func
	res := DllCall(ImageSetRotation_func,Int,id,Int, rotation)
	return res
}

DestroyAllVisual()
{
	global DestroyAllVisual_func
	res := DllCall(DestroyAllVisual_func)
	return res 
}

ShowAllVisual()
{
	global ShowAllVisual_func
	res := DllCall(ShowAllVisual_func)
	return res
}

HideAllVisual()
{
	global HideAllVisual_func
	res := DllCall(HideAllVisual_func )
	return res
}

GetFrameRate()
{
	global GetFrameRate_func
	res := DllCall(GetFrameRate_func )
	return res
}

GetScreenSpecs(ByRef width, ByRef height)
{
	global GetScreenSpecs_func
	res := DllCall(GetScreenSpecs_func, IntP, width, IntP, height)
	return res
}

SetCalculationRatio(width, height)
{
	global SetCalculationRatio_func
	res := DllCall(SetCalculationRatio_func, Int, width, Int, height)
	return res
}

SetOverlayPriority(id, priority)
{
	global SetOverlayPriority_func
	res := DllCall(SetOverlayPriority_func, Int, id, Int, priority)
	return res
}

RelToAbs(root, dir, s = &quot;\&quot;) {
	pr := SubStr(root, 1, len := InStr(root, s, &quot;&quot;, InStr(root, s . s) + 2) - 1)
		, root := SubStr(root, len + 1), sk := 0
	If InStr(root, s, &quot;&quot;, 0) = StrLen(root)
		StringTrimRight, root, root, 1
	If InStr(dir, s, &quot;&quot;, 0) = StrLen(dir)
		StringTrimRight, dir, dir, 1
	Loop, Parse, dir, %s%
	{
		If A_LoopField = ..
			StringLeft, root, root, InStr(root, s, &quot;&quot;, 0) - 1
		Else If A_LoopField =
			root =
		Else If A_LoopField != .
			Continue
		StringReplace, dir, dir, %A_LoopField%%s%
	}
	Return, pr . root . s . dir
}</code></pre></div><p>UPD: Только что попытался запустить скрипт не через инклуд а напрямую. Запустился успешно, однако мне необходимо его инклудить.<br />UPD2: Имелись откомпилированные версии моего .ahk скрипта, запустил их - все работает шикарно. Узнал какая версия AHK была до этого (в свойствах файла - 1.1.26.01) - откатился до неё, проблема осталась.</p>]]></description>
			<author><![CDATA[null@example.com (belyankin12)]]></author>
			<pubDate>Sun, 23 Dec 2018 17:23:03 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=130544#p130544</guid>
		</item>
	</channel>
</rss>
