<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Переменные в параметрах функции]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13602&amp;type=atom" />
	<updated>2018-04-05T15:34:20Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13602</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переменные в параметрах функции]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124476#p124476" />
			<content type="html"><![CDATA[<p><strong>ypppu</strong>, видел, но прочитанное не удалось осуществить на практике.</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2018-04-05T15:34:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124476#p124476</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переменные в параметрах функции]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124472#p124472" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Русская справка / Функции (v1.0.31+) Ник переводчика: Gourmet пишет:</cite><blockquote><p>Поскольку вызов функции является выражением, не следует заключать в знаки процента имена переменных в списке ее параметров. И напротив, буквальные строки необходимо заключать в двойные кавычки.</p></blockquote></div><p><span class="postimg"><img src="http://risovach.ru/thumb/upload/200s400/2014/02/mem/sashko_42568830_orig_.jpg" alt="http://risovach.ru/thumb/upload/200s400/2014/02/mem/sashko_42568830_orig_.jpg" /></span></p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2018-04-05T14:05:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124472#p124472</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переменные в параметрах функции]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124466#p124466" />
			<content type="html"><![CDATA[<p><strong>Indomito</strong>, Спасибо! Но мне не ясно, что именно я могу почерпнуть из приведенного примера.</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2018-04-05T04:22:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124466#p124466</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переменные в параметрах функции]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124465#p124465" />
			<content type="html"><![CDATA[<p><strong>becauseim</strong><br />Ещё вариант - передача массива.</p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>; 1-й параметр отвечает за показ True/False = показывать/не показывать. 
; 2-й параметр время ожидания закрытия процессов не менее 3 секунд.
; 3-й параметр массив процессов
; На выходе список закрытых процессов разделённых &quot;`n&quot;, на последнем нет &quot;`n&quot;
; Формат массива arNetApps := [&quot;процес№1.exe&quot;,&quot;процес№1.exe&quot;,&quot;процес№1.exe&quot;,&quot;процес№99.exe&quot;]   
fnKillWorkProc(vShow, vDelayIs,arListApps*)
{
  arKillWorkProcList  :=[[&quot;,&quot;,&quot;&quot;]]
  cMaxArListApps :=  arListApps.MaxIndex()  ;Расчёт длины входного массива
  Loop %cMaxArListApps%
    {
          ;b := arListApps[A_Index]
      arKillWorkProcList[A_Index,1]  := arListApps[A_Index]
      arKillWorkProcList[A_Index,2]  := &quot;&quot;
            ;a := arKillWorkProcList[A_Index,1] ; + arKillWorkProcList[A_Index,2]
            ;MsgBox i=%A_Index% Dist= %b% Param= %a%
    }
  If (vDelayIs&lt;3)
        vDelayIs :=3

  сMsgBoxInfo_Ok      :=0+8192+64 ;only an OK button + Task Modal + Icon Asterisk(info)
; Завершаем процессы
  titul := &quot;Результат закрытия процессов&quot; 
  res :=  &quot;&quot;
  If (vShow)
      res := &quot;`n`n&quot;
  i := 1
  vTF_res :=  False
  While (arKillWorkProcList[i,1])
    {
      CmdLine := arKillWorkProcList[i,1]
      If (fnCheckRestartWaitProcInter(CmdLine, vDelayIs-1))
            {
              CmdLine :=  arKillWorkProcList[i,1]
              CmdLine := &quot;taskkill /F /IM &quot; CmdLine
              RunCon(CmdLine, 0, Output)
              If (vShow)
                    {
                      arKillWorkProcList[i,2] := Output  &quot;`n&quot;
                      res  := res  arKillWorkProcList[i,2]
                    }  
                  Else
                    {
                      arKillWorkProcList[i,2] := Output
                      if (i=1)
                           res := res arKillWorkProcList[i,2]
                         Else
                           res := res &quot;`n&quot; arKillWorkProcList[i,2] 
                    }
              vTF_res :=  True
            }
      i++
    }
  If (vTF_res &amp;&amp; vShow)
        MsgBox, % сMsgBoxInfo_Ok, % titul, % res, % vDelayIs
 
Return  res
}</code></pre></div></div></div>]]></content>
			<author>
				<name><![CDATA[Indomito]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27285</uri>
			</author>
			<updated>2018-04-05T04:14:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124465#p124465</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переменные в параметрах функции]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124464#p124464" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, по запросу &quot;переменные в функции&quot; не нашлось. А примеры где-то наверняка есть.<br />Вроде заработало. Спасибо! <br /></p><div class="codebox"><pre><code>pricon := &quot;D:\Soft\AHK\Scripts\icons\Premiere 2018 ACER\&quot;
}
ImageWaitClick(pricon &quot;analyze.png&quot;, 500)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2018-04-05T01:43:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124464#p124464</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переменные в параметрах функции]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124463#p124463" />
			<content type="html"><![CDATA[<p>Неужели на нашем форуме не нашлось ни одного примера использования функций?<br />Переменные передаются в функцию без знаков процента и без кавычек:<br /></p><div class="codebox"><pre><code>var := &quot;text&quot;
MyFunc(var)

MyFunc(str)  {
   MsgBox, % str
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-04-05T01:38:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124463#p124463</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переменные в параметрах функции]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124462#p124462" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, сейчас все не перечислю. По-всякому варьировал использование символов % и &quot;. В сети сразу найти подходящие примеры не получилось, а документация мне сложна для понимания.</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2018-04-05T01:28:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124462#p124462</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переменные в параметрах функции]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124461#p124461" />
			<content type="html"><![CDATA[<p>А какие варианты вы рассматривали?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-04-05T01:23:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124461#p124461</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Переменные в параметрах функции]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124459#p124459" />
			<content type="html"><![CDATA[<p>Подскажите, пожалуйста, как верно внести переменную в параметры ф-ии?<br /></p><div class="codebox"><pre><code>
if (A_UserName= &quot;Admin&quot;){
pricon = D:\Soft\AHK\Scripts\icons\Premiere 2018 ACER\
}
ImageWaitClick(pricon &quot;analyze.png&quot;, 500) ; ???
return

ImageWaitClick(pic, time:=1000){
	CoordMode, Pixel, Screen
	EndTime := A_TickCount + time
	While EndTime&gt;A_TickCount {
	ImageSearch, picX, picY, 0, 0, A_ScreenWidth, A_ScreenHeight, % pic 
	If !ErrorLevel
		Break
	}
	If ErrorLevel
		Tippy(&quot;Image Not Found!&quot;, 2000)
	Else
		ClickAndReturn(picX,picY)
}
ClickAndReturn(x,y){
	ControlGetPos ,,,,,, ahk_id %StartCtrl%
	MouseGetPos, StartX, StartY
	MouseClick, , %x%, %y%, , 0.1
	MouseMove, StartX, StartY
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2018-04-05T00:10:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124459#p124459</id>
		</entry>
</feed>
