<?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=10407&amp;type=atom" />
	<updated>2015-04-07T11:10:18Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=10407</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм работы с плавующим количеством переменных]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93079#p93079" />
			<content type="html"><![CDATA[<p>Спасибо. Надоедят мелькания в моем скрипте, возьмусь изучать ListView.<br />Пока, те примеры, которые я посмотрел говорят, что копаться с ListView с моими знаниями и для моих целей придется весьма большое количество времени.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-04-07T11:10:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93079#p93079</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм работы с плавующим количеством переменных]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93077#p93077" />
			<content type="html"><![CDATA[<p>По части GUI - это лучше сделать через ListView, там есть встроенная сортировка. В строке колонки &quot;Активировать&quot;, &quot;Имя переменной&quot;, &quot;Дата&quot;, &quot;Лог&quot;. Активировать-деактивировать можно щелчком мышки в ячейке &quot;Активировать&quot;. Снизу прикрутить кнопки &quot;Добавить&quot;, &quot;Редактировать&quot;, &quot;Удалить&quot; с вызовом дополнительных GUI.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2015-04-07T09:44:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93077#p93077</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм работы с плавующим количеством переменных]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93074#p93074" />
			<content type="html"><![CDATA[<p>А задача - управлять базой данных через гуи&nbsp; -добавлять новые группы переменных, изменять их, сохранять, активировать, деактивировать на время. И сортировать по категории: &quot;Дата&quot;. И у каждой группы есть свой лог файл в который ведется запись.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-04-07T09:04:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93074#p93074</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм работы с плавующим количеством переменных]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93071#p93071" />
			<content type="html"><![CDATA[<p>Всё какие-то новые обстоятельства вылезают. Предлагаю ещё раз сформулировать задачу со всеми подробностями.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2015-04-07T07:12:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93071#p93071</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм работы с плавующим количеством переменных]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93060#p93060" />
			<content type="html"><![CDATA[<p>Irbis, наверное это несколько не то, что я хотел получить.<br />Я хочу что-то такое, но без Reload и без простыни кода для появления ползунка.<br /></p><div class="quotebox"><blockquote><p>Ну, если вы через гуй получили новое значение переменной, то почему его просто не присвоить этой переменной?</p></blockquote></div><p>Не представляю, как я смогу это осуществить с этой кучей переменных.</p><p>test.txt<br /></p><div class="codebox"><pre><code>all := 0, Pos := 10</code></pre></div><p>test.ahk<br /></p><div class="codebox"><pre><code>#SingleInstance, force
#Include, test.txt
SetBatchLines, -1
FileRead, DataBase, *t test.txt
DataBaseBeforeSort := DataBase
Sort, Database
If (DataBaseBeforeSort != DataBase)
{
   FileDelete, test.txt
   FileAppend, %Database%, test.txt
   Reload
}
Gui, New, +hwndHGUI +Resize
n := MaxPos := 0
loop % all
{
   n++
   while (name%n% = &quot;&quot;)
      n++
   If (status%n% = &quot;disabled&quot;)
      Checked := &quot;&quot;
   Else
      Checked := &quot;Checked&quot;
   Pos := pos%n%
   if (MaxPos &lt; Pos)
      MaxPos := Pos
   Gui, Add, CheckBox, x12 y%Pos%  w20 h20 %Checked% gChkChange v%n%
   Gui, Add, Edit, x32 y%Pos%  w70 h20 vName%n%, % name%n%
   Gui, Add, Edit, x102 y%Pos% w100 h20 vEmail%n%, % email%n%
   Gui, Add, Edit, x202 y%Pos% w100 h20 vDate%n%, % date%n%
   Gui, Add, Edit, x302 y%Pos% w100 h20 vLink%n%, % link%n%
   Gui, Add, Edit, x402 y%Pos% w100 h20 vFilter%n%, % filter%n%
   Gui, Add, Button, x512 y%Pos% w100 h20 gButtonWriteEmail vButtonWriteEmail%n%, Написать Имейл
   Gui, Add, Button, x622 y%Pos% w100 h20 gButtonSave vButtonSave%n%, Изменить
   Gui, Add, Button, x734 y%Pos% w100 h20 gButtonDelete vButtonDelete%n%, Удалить
   If (status%n% = &quot;disabled&quot;)
   {
      GuiControl, Disable, Name%n%
      GuiControl, Disable, Email%n%
      GuiControl, Disable, date%n%
      GuiControl, Disable, link%n%
      GuiControl, Disable, filter%n%
   }
}
Pos := MaxPos + 40
Gui, Add, Edit, x32 y%Pos%  w70 h20 vNewName, Имя
Gui, Add, Edit, x102 y%Pos% w100 h20 vNewEmail, @
Gui, Add, Edit, x202 y%Pos%  w100 h20 vNewDate, 2015.06.31
Gui, Add, Edit, x302 y%Pos% w100 h20 vNewLink, Ссылка
Gui, Add, Edit, x402 y%Pos% w100 h20 vNewFilter, Фильтр
Gui, Add, Button, x512 y%Pos% w100 h20 gButtonAdd, Добавить
Pos += 50
Gui, Add, Button, x102 y%Pos% w150 h30 gButtonOK, Запустить скрипт
Gui, Add, Button, x262 y%Pos% w150 h30 gButtonCancel, Остановить скрипт
Global SG1 := New ScrollGUI(HGUI, 1000, 500, &quot;+Resize +LabelGui&quot;, 3, 4)
SG1.Show(&quot;DataBase&quot;, &quot;ycenter xcenter&quot;)
Return

ChkChange:
Gui, Submit, NoHide
n := A_GuiControl
pos := RegexMatch(DataBase, &quot;[^\n]+?&quot;&quot;, n := &quot; n &quot;,.*?, status%n% := &quot;&quot;(.*?)&quot;&quot;&quot;, match)
GuiControlGet, CheckBoxState,, %A_GuiControl%
If (CheckBoxState = 1)
   DataBase := RegexReplace(DataBase, &quot;disabled&quot;, &quot;enabled&quot;,,1, pos)
Else
   DataBase := RegexReplace(DataBase, &quot;enabled&quot;, &quot;disabled&quot;,,1, pos)
DataBase := RegExReplace(DataBase, &quot;\n+&quot;, &quot;`n&quot;)
Sort, Database
FileDelete, test.txt
FileAppend, %DataBase%, test.txt
Reload
Return

ButtonAdd:
Gui, Submit, NoHide
If !Instr(NewEmail, &quot;@&quot;)
{
   msgbox, Неправильный Имейл
   return
}
if !RegexMatch(NewDate,&quot;\d\d\d\d\.\d\d\.\d\d&quot;) or RegexMatch(NewDate,&quot;\S\S\S\S\S\S\S\S\S\S\S&quot;)
{
   msgbox, Неправильная дата
   return
}
n := 1
loop 
{
   while (name%n% != &quot;&quot;)
      n++
   break
}
DataBase .= &quot;`nsort := &quot;&quot;&quot; NewDate &quot;&quot;&quot;, n := &quot; n &quot;, name%n% := &quot;&quot;&quot; NewName &quot;&quot;&quot;, email%n% := &quot;&quot;&quot; NewEmail &quot;&quot;&quot;, date%n% := &quot;&quot;&quot; NewDate &quot;&quot;&quot;, link%n% := &quot;&quot;&quot; NewLink &quot;&quot;&quot;, filter%n% := &quot;&quot;&quot; NewFilter &quot;&quot;&quot;, log%n% := &quot;&quot;D:\&quot; n &quot;.txt&quot;&quot;, pos%n% := Pos, Pos+=30, all++, status%n% := &quot;&quot;enabled&quot;&quot;`n&quot;
DataBase := RegExReplace(DataBase, &quot;\n+&quot;, &quot;`n&quot;)
Sort, DataBase
FileDelete, test.txt
FileAppend, %DataBase%, test.txt
Reload
Return


ButtonSave:
Gui, Submit, NoHide
n := RegExReplace(A_GuiControl, &quot;\D&quot;)
If !Instr(email%n%, &quot;@&quot;)
{
   msgbox, Неправильный Имейл
   return
}
if !RegexMatch(date%n%,&quot;\d\d\d\d\.\d\d\.\d\d&quot;) or RegexMatch(date%n%,&quot;\S\S\S\S\S\S\S\S\S\S\S&quot;)
{
   msgbox, Неправильная дата
   return
}
DataBase := RegexReplace(DataBase, &quot;[^\n]+?&quot;&quot;, n := &quot; n &quot;,.*?\n&quot;, &quot;`nsort := &quot;&quot;&quot; date%n% &quot;&quot;&quot;, n := &quot; n &quot;, name%n% := &quot;&quot;&quot; name%n% &quot;&quot;&quot;, email%n% := &quot;&quot;&quot; email%n% &quot;&quot;&quot;, date%n% := &quot;&quot;&quot; date%n% &quot;&quot;&quot;, link%n% := &quot;&quot;&quot; link%n% &quot;&quot;&quot;, filter%n% := &quot;&quot;&quot; filter%n% &quot;&quot;&quot;, log%n% := &quot;&quot;D:\&quot; n &quot;.txt&quot;&quot;, pos%n% := Pos, Pos+=30, all++, status%n% := &quot;&quot;enabled&quot;&quot;`n&quot;)
DataBase := RegExReplace(DataBase, &quot;\n+&quot;, &quot;`n&quot;)
Sort, DataBase
FileDelete, test.txt
FileAppend, %DataBase%, test.txt
Reload
Return

ButtonDelete:
Gui, Submit, NoHide
n := RegExReplace(A_GuiControl, &quot;\D&quot;)
MsgBox, 4, , % &quot;Вы действительно хотите удалить &quot; email%n%
IfMsgBox No
   return
DataBase := RegexReplace(DataBase, &quot;[^\n]+?&quot;&quot;, n := &quot; n &quot;,.*?\n&quot;, &quot;`n&quot;)
DataBase := RegExReplace(DataBase, &quot;\n+&quot;, &quot;`n&quot;)
Sort, DataBase
FileDelete, test.txt
FileAppend, %DataBase%, test.txt
Reload
Return

ButtonWriteEmail:
Gui, Submit, NoHide
n := RegExReplace(A_GuiControl, &quot;\D&quot;)
send_email(&quot;апаропро! īīīuuuuņiuī&quot;, email%n%)
MsgBox, Сообщение послано!
Return

ButtonOk:
msgbox, скрипт запущен
Return

ButtonCancel:
GuiClose:
ExitApp

send_email(Text, To)
{
   ComObjError(false)
   pmsg := ComObjCreate(&quot;CDO.Message&quot;)
   pmsg.From := &quot;user5@gmail.com&quot;
   pmsg.To := To
   pmsg.Subject := &quot;test&quot;
   pmsg.TextBody := Text
   pmsg.TextBodyPart.Charset := &quot;utf-8&quot;
   fields := Object()
   fields.smtpserver := &quot;smtp.gmail.com&quot; ; specify your SMTP server
   fields.smtpserverport := 465
   fields.smtpusessl := True ; False
   fields.sendusing := 2   ; cdoSendUsingPort
   fields.smtpauthenticate := 1   ; cdoBasic
   fields.sendusername := &quot;qwerty@gmail.com&quot;
   fields.sendpassword := &quot;qwerty&quot;
   fields.smtpconnectiontimeout := 60
   schema := &quot;http://schemas.microsoft.com/cdo/configuration/&quot;
   pfld := pmsg.Configuration.Fields
   For field,value in fields
      pfld.Item(schema . field) := value
   pfld.Update()
   pmsg.Send()
   return
}

; ======================================================================================================================
; Namepace:       ScrollGUI
; Function:       Creates a scrollable GUI as a parent for GUI windows.
; Tested with:    AHK 1.1.20.03 (1.1.20+ required)
; Tested on:      Win 8.1 (x64)
; License:        The Unlicense -&gt; http://unlicense.org
; Change log:
;                 1.0.00.00/2015-02-06/just me        -  initial release on ahkscript.org
;                 1.0.01.00/2015-02-08/just me        -  bug fixes
;                 1.1.00.00/2015-02-13/just me        -  bug fixes, mouse wheel handling, AutoSize method
;                 1.2.00.00/2015-03-12/just me        -  mouse wheel handling, resizing, OnMessage, bug fixes
; ======================================================================================================================
Class ScrollGUI {
   Static Instances := []
   ; ===================================================================================================================
   ; __New          Creates a scrollable parent window (ScrollGUI) for the passed GUI.
   ; Parameters:
   ;    HGUI        -  HWND of the GUI child window.
   ;    Width       -  Width of the client area of the ScrollGUI.
   ;                   Pass 0 to set the client area to the width of the child GUI.
   ;    Height      -  Height of the client area of the ScrollGUI.
   ;                   Pass 0 to set the client area to the height of the child GUI.
   ;    ----------- Optional:
   ;    GuiOptions  -  GUI options to be used when creating the ScrollGUI (e.g. +LabelMyLabel).
   ;                   Default: empty (no options)
   ;    ScrollBars  -  Scroll bars to register:
   ;                   1 : horizontal
   ;                   2 : vertical
   ;                   3 : both
   ;                   Default: 3
   ;    Wheel       -  Register WM_MOUSEWHEEL / WM_MOUSEHWHEEL messages:
   ;                   1 : register WM_MOUSEHWHEEL for horizontal scrolling (reqires Win Vista+)
   ;                   2 : register WM_MOUSEWHEEL for vertical scrolling
   ;                   3 : register both
   ;                   4 : register WM_MOUSEWHEEL for vertical and Shift+WM_MOUSEWHEEL for horizontal scrolling
   ;                   Default: 0
   ; Return values:
   ;    On failure:    False
   ; Remarks:
   ;    The dimensions of the child GUI are determined internally according to the visible children.
   ;    The maximum width and height of the parent GUI will be restricted to the dimensions of the child GUI.
   ;    If you register mouse wheel messages, the messages will be passed to the focused control, unless the mouse 
   ;    is hovering on one of the ScrollGUI&#039;s scroll bars. If the control doesn&#039;t process the message, it will be
   ;    returned back to the ScrollGUI.
   ;    Common controls seem to ignore wheel messages whenever the CTRL is down. So you can use this modifier to 
   ;    scroll the ScrollGUI even if a scrollable control has the focus.
   ; ===================================================================================================================
   __New(HGUI, Width, Height, GuiOptions := &quot;&quot;, ScrollBars := 3, Wheel := 0) {
      Static WS_HSCROLL := &quot;0x100000&quot;, WS_VSCROLL := &quot;0x200000&quot;
      Static FN_SCROLL := ObjBindMethod(ScrollGui, &quot;On_WM_Scroll&quot;)
      Static FN_SIZE := ObjBindMethod(ScrollGui, &quot;On_WM_Size&quot;)
      Static FN_WHEEL := ObjBindMethod(ScrollGUI, &quot;On_WM_Wheel&quot;)
      ScrollBars &amp;= 3
      Wheel &amp;= 7
      If ((ScrollBars &lt;&gt; 1) &amp;&amp; (ScrollBars &lt;&gt; 2) &amp;&amp; (ScrollBars &lt;&gt; 3))
      || ((Wheel &lt;&gt; 0) &amp;&amp; (Wheel &lt;&gt; 1) &amp;&amp; (Wheel &lt;&gt; 2) &amp;&amp; (Wheel &lt;&gt; 3) &amp;&amp; (Wheel &lt;&gt; 4))
         Return False
      If !DllCall(&quot;User32.dll\IsWindow&quot;, &quot;Ptr&quot;, HGUI, &quot;UInt&quot;)
         Return False
      VarSetCapacity(RC, 16, 0)
      ; Child GUI
      If !This.AutoSize(HGUI, GuiW, GuiH)
         Return False
      Gui, %HGUI%:-Caption -Resize
      Gui, %HGUI%:Show, w%GuiW% h%GuiH% Hide
      MaxH := GuiW
      MaxV := GuiH
      LineH := Ceil(MaxH / 20)
      LineV := Ceil(MaxV / 20)
      ; ScrollGUI
      If (Width = 0) || (Width &gt; MaxH)
         Width := MaxH
      If (Height = 0) || (Height &gt; MaxV)
         Height := MaxV
      Styles := (ScrollBars &amp; 1 ? &quot; +&quot; . WS_HSCROLL : &quot;&quot;) . (ScrollBars &amp; 2 ? &quot; +&quot; . WS_VSCROLL : &quot;&quot;)
      Gui, New, %GuiOptions% %Styles% +hwndHWND
      Gui, %HWND%:Show, w%Width% h%Height% Hide
      Gui, %HWND%:+MaxSize%MaxH%x%MaxV%
      PageH := Width + 1
      PageV := Height + 1
      ; Instance variables
      This.HWND := HWND + 0
      This.HGUI := HGUI
      This.Width := Width
      This.Height := Height
      This.UseShift := False
      If (ScrollBars &amp; 1) {
         This.SetScrollInfo(0, {Max: MaxH, Page: PageH, Pos: 0}) ; SB_HORZ = 0
         OnMessage(0x0114, FN_SCROLL) ; WM_HSCROLL = 0x0114
         If (Wheel &amp; 1)
            OnMessage(0x020E, FN_WHEEL) ; WM_MOUSEHWHEEL = 0x020E
         Else If (Wheel &amp; 4) {
            OnMessage(0x020A, FN_WHEEL) ; WM_MOUSEWHEEL = 0x020A
            This.UseShift := True
         }
         This.MaxH := MaxH
         This.LineH := LineH
         This.PageH := PageH
         This.PosH := 0
         This.ScrollH := True
         If (Wheel &amp; 5)
            This.WheelH := True
      }
      If (ScrollBars &amp; 2) {
         This.SetScrollInfo(1, {Max: MaxV, Page: PageV, Pos: 0}) ; SB_VERT = 1
         OnMessage(0x0115, FN_SCROLL) ; WM_VSCROLL = 0x0115
         If (Wheel &amp; 6)
            OnMessage(0x020A, FN_WHEEL) ; WM_MOUSEWHEEL = 0x020A
         This.MaxV := MaxV
         This.LineV := LineV
         This.PageV := PageV
         This.PosV := 0
         This.ScrollV := True
         If (Wheel &amp; 6)
            This.WheelV := True
      }
      ; Set the position of the child GUI
      Gui, %HGUI%:+Parent%HWND%
      Gui, %HGUI%:Show, x0 y0
      ; Adjust the scroll bars
      This.Instances[This.HWND] := &amp;This
      This.Size()
      OnMessage(0x0005, FN_SIZE) ; WM_SIZE = 0x0005
   }
   ; ===================================================================================================================
   ; __Delete       Destroy the GUIs, if they still exist.
   ; ===================================================================================================================
   __Delete() {
      This.Destroy()
   }
   ; ===================================================================================================================
   ; Show           Shows the ScrollGUI.
   ; Parameters:
   ;    Title       -  Title of the ScrollGUI window
   ;    ShowOptions -  Gui, Show command options, width or height options are ignored
   ; Return values:
   ;    On success: True
   ;    On failure: False
   ; ===================================================================================================================
   Show(Title := &quot;&quot;, ShowOptions := &quot;&quot;) {
      ShowOptions := RegExReplace(ShowOptions, &quot;i)\+?AutoSize&quot;)
      W := This.Width
      H := This.Height
      Gui, % This.HWND . &quot;:Show&quot;, %ShowOptions% w%W% h%H%, %Title%
      Return True
   }
   ; ===================================================================================================================
   ; Destroy        Destroys the ScrollGUI and the associated child GUI.
   ; Parameters:
   ;    None.
   ; Return values:
   ;    On success: True
   ;    On failure: False
   ; Remarks:
   ;    Use this method instead of &#039;Gui, Destroy&#039; to remove the ScrollGUI from the &#039;Instances&#039; object.
   ; ===================================================================================================================
   Destroy() {
      If This.Instances.HasKey(This.HWND) {
         Gui, % This.HWND . &quot;:Destroy&quot;
         This.Instances.Remove(This.HWND, &quot;&quot;)
         Return True
      }
   }
   ; ===================================================================================================================
   ; AdjustToChild  Adjust the scroll bars to the new child dimensions.
   ; Parameters:
   ;    None
   ; Return values:
   ;    On success: True
   ;    On failure: False
   ; Remarks:
   ;    Call this method whenever the visible area of the child GUI has to be changed, e.g. after adding, hiding,
   ;    unhiding, resizing, or repositioning controls.
   ;    The dimensions of the child GUI are determined internally according to the visible children.
   ; ===================================================================================================================
   AdjustToChild() {
      VarSetCapacity(RC, 16, 0)
      DllCall(&quot;User32.dll\GetWindowRect&quot;, &quot;Ptr&quot;, This.HGUI, &quot;Ptr&quot;, &amp;RC)
      PrevW := NumGet(RC, 8, &quot;Int&quot;) - NumGet(RC, 0, &quot;Int&quot;)
      PrevH := Numget(RC, 12, &quot;Int&quot;) - NumGet(RC, 4, &quot;Int&quot;)
      DllCall(&quot;User32.dll\ScreenToClient&quot;, &quot;Ptr&quot;, This.HWND, &quot;Ptr&quot;, &amp;RC)
      XC := XN := NumGet(RC, 0, &quot;Int&quot;)
      YC := YN := NumGet(RC, 4, &quot;Int&quot;)
      If !This.AutoSize(This.HGUI, GuiW, GuiH)
         Return False
      Gui, % This.HGUI . &quot;:Show&quot;, x%XC% y%YC% w%GuiW% h%GuiH%
      MaxH := GuiW
      MaxV := GuiH
      Gui, % This.HWND . &quot;:+MaxSize&quot; . MaxH . &quot;x&quot; . MaxV
      If (GuiW &lt; This.Width) || (GuiH &lt; This.Height) {
         Gui, % This.HWND . &quot;:Show&quot;, w%GuiW% h%GuiH%
         This.Width := GuiW
         This.SetPage(1, MaxH + 1)
         This.Height := GuiH
         This.SetPage(2, MaxV + 1)
      }
      LineH := Ceil(MaxH / 20)
      LineV := Ceil(MaxV / 20)
      If This.ScrollH {
         This.SetMax(1, MaxH)
         This.LineH := LineH
         If (XC + MaxH) &lt; This.Width {
            XN += This.Width - (XC + MaxH)
            If (XN &gt; 0)
               XN := 0
            This.SetScrollInfo(0, {Pos: XN * -1})
            This.GetScrollInfo(0, SI)
            This.PosH := NumGet(SI, 20, &quot;Int&quot;)
         }
      }
      If This.ScrollV {
         This.SetMax(2, MaxV)
         This.LineV := LineV
         If (YC + MaxV) &lt; This.Height {
            YN += This.Height - (YC + MaxV)
            If (YN &gt; 0)
               YN := 0
            This.SetScrollInfo(1, {Pos: YN * -1})
            This.GetScrollInfo(1, SI)
            This.PosV := NumGet(SI, 20, &quot;Int&quot;)
         }
      }
      If (XC &lt;&gt; XN) || (YC &lt;&gt; YN)
         DllCall(&quot;User32.dll\ScrollWindow&quot;, &quot;Ptr&quot;, This.HWND, &quot;Int&quot;, XN - XC, &quot;Int&quot;, YN - YC, &quot;Ptr&quot;, 0, &quot;Ptr&quot;, 0)
      Return True
   }
   ; ===================================================================================================================
   ; SetMax         Sets the width or height of the scrolling area.
   ; Parameters:
   ;    SB          -  Scroll bar to set the value for:
   ;                   1 = horizontal
   ;                   2 = vertical
   ;    Max         -  Width respectively height of the scrolling area in pixels
   ; Return values:
   ;    On success: True
   ;    On failure: False
   ; ===================================================================================================================
   SetMax(SB, Max) {
      ; SB_HORZ = 0, SB_VERT = 1
      SB--
      If (SB &lt;&gt; 0) &amp;&amp; (SB &lt;&gt; 1)
         Return False
      If (SB = 0)
         This.MaxH := Max
      Else
         This.MaxV := Max
      Return This.SetScrollInfo(SB, {Max: Max})
   }
   ; ===================================================================================================================
   ; SetLine        Sets the number of pixels to scroll by line.
   ; Parameters:
   ;    SB          -  Scroll bar to set the value for:
   ;                   1 = horizontal
   ;                   2 = vertical
   ;    Line        -  Number of pixels.
   ; Return values:
   ;    On success: True
   ;    On failure: False
   ; ===================================================================================================================
   SetLine(SB, Line) {
      ; SB_HORZ = 0, SB_VERT = 1
      SB--
      If (SB &lt;&gt; 0) &amp;&amp; (SB &lt;&gt; 1)
         Return False
      If (SB = 0)
         This.LineH := Line
      Else
         This.LineV := Line
      Return True
   }
   ; ===================================================================================================================
   ; SetPage        Sets the number of pixels to scroll by page.
   ; Parameters:
   ;    SB          -  Scroll bar to set the value for:
   ;                   1 = horizontal
   ;                   2 = vertical
   ;    Page        -  Number of pixels.
   ; Return values:
   ;    On success: True
   ;    On failure: False
   ; Remarks:
   ;    If the ScrollGUI is resizable, the page size will be recalculated automatically while resizing.
   ; ===================================================================================================================
   SetPage(SB, Page) {
      ; SB_HORZ = 0, SB_VERT = 1
      SB--
      If (SB &lt;&gt; 0) &amp;&amp; (SB &lt;&gt; 1)
         Return False
      If (SB = 0)
         This.PageH := Page
      Else
         This.PageV := Page
      Return This.SetScrollInfo(SB, {Page: Page})
   }
   ; ===================================================================================================================
   ; Methods for internal or system use!!!
   ; ===================================================================================================================
   AutoSize(HGUI, ByRef Width, ByRef Height) {
      DHW := A_DetectHiddenWindows
      DetectHiddenWindows, On
      VarSetCapacity(RECT, 16, 0)
      Width := Height := 0
      HWND := HGUI
      CMD := 5 ; GW_CHILD
      L := T := R := B := LH := TH := &quot;&quot;
      While (HWND := DllCall(&quot;GetWindow&quot;, &quot;Ptr&quot;, HWND, &quot;UInt&quot;, CMD, &quot;UPtr&quot;)) &amp;&amp; (CMD := 2) {
         WinGetPos, X, Y, W, H, ahk_id %HWND%
         W += X, H += Y
         WinGet, Styles, Style, ahk_id %HWND%
         If (Styles &amp; 0x10000000) { ; WS_VISIBLE
            If (L = &quot;&quot;) || (X &lt; L)
               L := X
            If (T = &quot;&quot;) || (Y &lt; T)
               T := Y
            If (R = &quot;&quot;) || (W &gt; R)
               R := W
            If (B = &quot;&quot;) || (H &gt; B)
               B := H
         }
         Else {
            If (LH = &quot;&quot;) || (X &lt; LH)
               LH := X
            If (TH = &quot;&quot;) || (Y &lt; TH)
               TH := Y
         }
      }
      DetectHiddenWindows, %DHW%
      If (LH &lt;&gt; &quot;&quot;) {
         VarSetCapacity(POINT, 8, 0)
         NumPut(LH, POINT, 0, &quot;Int&quot;)
         DllCall(&quot;ScreenToClient&quot;, &quot;Ptr&quot;, HGUI, &quot;Ptr&quot;, &amp;POINT)
         LH := NumGet(POINT, 0, &quot;Int&quot;)
      }
      If (TH &lt;&gt; &quot;&quot;) {
         VarSetCapacity(POINT, 8, 0)
         NumPut(TH, POINT, 4, &quot;Int&quot;)
         DllCall(&quot;ScreenToClient&quot;, &quot;Ptr&quot;, HGUI, &quot;Ptr&quot;, &amp;POINT)
         TH := NumGet(POINT, 4, &quot;Int&quot;)
      }
      NumPut(L, RECT, 0, &quot;Int&quot;), NumPut(T, RECT,  4, &quot;Int&quot;)
      NumPut(R, RECT, 8, &quot;Int&quot;), NumPut(B, RECT, 12, &quot;Int&quot;)
      DllCall(&quot;MapWindowPoints&quot;, &quot;Ptr&quot;, 0, &quot;Ptr&quot;, HGUI, &quot;Ptr&quot;, &amp;RECT, &quot;UInt&quot;, 2)
      Width := NumGet(RECT, 8, &quot;Int&quot;) + (LH &lt;&gt; &quot;&quot; ? LH : NumGet(RECT, 0, &quot;Int&quot;))
      Height := NumGet(RECT, 12, &quot;Int&quot;) + (TH &lt;&gt; &quot;&quot; ? TH : NumGet(RECT,  4, &quot;Int&quot;))
      Return True
   }
   ; ===================================================================================================================
   GetScrollInfo(SB, ByRef SI) {
      VarSetCapacity(SI, 28, 0) ; SCROLLINFO
      NumPut(28, SI, 0, &quot;UInt&quot;)
      NumPut(0x17, SI, 4, &quot;UInt&quot;) ; SIF_ALL = 0x17
      Return DllCall(&quot;User32.dll\GetScrollInfo&quot;, &quot;Ptr&quot;, This.HWND, &quot;Int&quot;, SB, &quot;Ptr&quot;, &amp;SI, &quot;UInt&quot;)
   }
   ; ===================================================================================================================
   SetScrollInfo(SB, Values) {
      Static SIF := {Max: 0x01, Page: 0x02, Pos: 0x04}
      Static Off := {Max: 12, Page: 16, Pos: 20}
      Mask := 0
      VarSetCapacity(SI, 28, 0) ; SCROLLINFO
      NumPut(28, SI, 0, &quot;UInt&quot;)
      For Key, Value In Values {
         If SIF.HasKey(Key) {
            Mask |= SIF[Key]
            NumPut(Value, SI, Off[Key], &quot;UInt&quot;)
         }
      }
      If (Mask) {
         NumPut(Mask | 0x08, SI, 4, &quot;UInt&quot;) ; SIF_DISABLENOSCROLL = 0x08
         Return DllCall(&quot;User32.dll\SetScrollInfo&quot;, &quot;Ptr&quot;, This.HWND, &quot;Int&quot;, SB, &quot;Ptr&quot;, &amp;SI, &quot;UInt&quot;, 1, &quot;UInt&quot;)
      }
      Return False
   }
   ; ===================================================================================================================
   On_WM_Scroll(WP, LP, Msg, HWND) {
      ; WM_HSCROLL = 0x0114, WM_VSCROLL = 0x0115
      If (Instance := Object(This.Instances[HWND]))
         If ((Msg = 0x0114) &amp;&amp; Instance.ScrollH)
         || ((Msg = 0x0115) &amp;&amp; Instance.ScrollV)
            Return Instance.Scroll(WP, LP, Msg, HWND)
   }
   ; ===================================================================================================================
   Scroll(WP, LP, Msg, HWND) {
      ; WM_HSCROLL = 0x0114, WM_VSCROLL = 0x0115
      Static SB_LINEMINUS := 0, SB_LINEPLUS := 1, SB_PAGEMINUS := 2, SB_PAGEPLUS := 3, SB_THUMBTRACK := 5
      If (LP &lt;&gt; 0)
         Return
      SB := (Msg = 0x0114 ? 0 : 1) ; SB_HORZ : SB_VERT
      SC := WP &amp; 0xFFFF
      SD := (Msg = 0x0114 ? This.LineH : This.LineV)
      SI := 0
      If !This.GetScrollInfo(SB, SI)
         Return
      PA := PN := NumGet(SI, 20, &quot;Int&quot;)
      PN := (SC = 0) ? PA - SD ; SB_LINEMINUS
          : (SC = 1) ? PA + SD ; SB_LINEPLUS
          : (SC = 2) ? PA - NumGet(SI, 16, &quot;UInt&quot;) ; SB_PAGEMINUS
          : (SC = 3) ? PA + NumGet(SI, 16, &quot;UInt&quot;) ; SB_PAGEPLUS
          : (SC = 5) ? NumGet(SI, 24, &quot;Int&quot;) ; SB_THUMBTRACK
          : PA
      If (PA = PN)
         Return 0
      This.SetScrollInfo(SB, {Pos: PN})
      This.GetScrollInfo(SB, SI)
      PN := NumGet(SI, 20, &quot;Int&quot;)
      If (SB = 0)
         This.PosH := PN
      Else
         This.PosV := PN
      If (PA &lt;&gt; PN) {
         HS := (Msg = 0x0114) ? PA - PN : 0
         VS := (Msg = 0x0115) ? PA - PN : 0
         DllCall(&quot;User32.dll\ScrollWindow&quot;, &quot;Ptr&quot;, This.HWND, &quot;Int&quot;, HS, &quot;Int&quot;, VS, &quot;Ptr&quot;, 0, &quot;Ptr&quot;, 0)
      }
      Return 0
   }
   ; ===================================================================================================================
   On_WM_Size(WP, LP, Msg, HWND) {
      If ((WP = 0) || (WP = 2)) &amp;&amp; (Instance := Object(This.Instances[HWND]))
         Return Instance.Size(LP &amp; 0xFFFF, (LP &gt;&gt; 16) &amp; 0xFFFF)
   }
   ; ===================================================================================================================
   Size(Width := 0, Height := 0) {
      If (Width = 0) || (Height = 0) {
         VarSetCapacity(RC, 16, 0)
         DllCall(&quot;User32.dll\GetClientRect&quot;, &quot;Ptr&quot;, This.HWND, &quot;Ptr&quot;, &amp;RC)
         Width := NumGet(RC, 8, &quot;Int&quot;)
         Height := Numget(RC, 12, &quot;Int&quot;)
      }
      SH := SV := 0
      If This.ScrollH {
         If (Width &lt;&gt; This.Width) {
            This.SetScrollInfo(0, {Page: Width + 1})
            This.Width := Width
            This.GetScrollInfo(0, SI)
            PosH := NumGet(SI, 20, &quot;Int&quot;)
            SH := This.PosH - PosH
            This.PosH := PosH
         }
      }
      If This.ScrollV {
         If (Height &lt;&gt; This.Height) {
            This.SetScrollInfo(1, {Page: Height + 1})
            This.Height := Height
            This.GetScrollInfo(1, SI)
            PosV := NumGet(SI, 20, &quot;Int&quot;)
            SV := This.PosV - PosV
            This.PosV := PosV
         }
      }
      If (SH) || (SV)
         DllCall(&quot;User32.dll\ScrollWindow&quot;, &quot;Ptr&quot;, This.HWND, &quot;Int&quot;, SH, &quot;Int&quot;, SV, &quot;Ptr&quot;, 0, &quot;Ptr&quot;, 0)
      Return 0
   }
   ; ===================================================================================================================
   On_WM_Wheel(WP, LP, Msg, HWND) {
      ; MK_SHIFT = 0x0004, WM_MOUSEWHEEL = 0x020A, WM_MOUSEHWHEEL = 0x020E, WM_NCHITTEST = 0x0084
      HACT := WinActive(&quot;A&quot;) + 0
      If (HACT &lt;&gt; HWND) &amp;&amp; (Instance := Object(This.Instances[HACT])) {
         SendMessage, 0x0084, 0, % (LP &amp; 0xFFFFFFFF), , ahk_id %HACT%
         OnBar := ErrorLevel
         If (OnBar = 6) &amp;&amp; Instance.WheelH ; HTHSCROLL = 6
            Return Instance.Wheel(WP, LP, 0x020E, HACT)
         If (OnBar = 7) &amp;&amp; Instance.WheelV ; HTVSCROLL = 7
            Return Instance.Wheel(WP, LP, 0x020A, HACT)
      }
      If (Instance := Object(This.Instances[HWND])) {
         If ((Msg = 0x020E) &amp;&amp; Instance.WheelH)
         || ((Msg = 0x020A) &amp;&amp; (Instance.WheelV || (Instance.WheelH &amp;&amp; Instance.UseShift &amp;&amp; (WP &amp; 0x0004))))
            Return Instance.Wheel(WP, LP, Msg, HWND)
      }
   }
   ; ===================================================================================================================
   Wheel(WP, LP, Msg, HWND) {
      ; MK_SHIFT = 0x0004, WM_MOUSEWHEEL = 0x020A, WM_MOUSEHWHEEL = 0x020E, WM_HSCROLL = 0x0114, WM_VSCROLL = 0x0115
      ; SB_LINEMINUS = 0, SB_LINEPLUS = 1
      If (Msg = 0x020A) &amp;&amp; This.UseShift &amp;&amp; (WP &amp; 0x0004)
         Msg := 0x020E
      Msg := (Msg = 0x020A ? 0x0115 : 0x0114)
      SB := ((WP &gt;&gt; 16) &gt; 0x7FFF) || (WP &lt; 0) ? 1 : 0
      Return This.Scroll(SB, 0, Msg, HWND)
   }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-04-06T11:34:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93060#p93060</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм работы с плавующим количеством переменных]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93055#p93055" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>IniFile := A_ScriptDir . &quot;\Test.ini&quot;
Loop {
   IniRead, Param, %IniFile%, Settings, Server%A_Index%, %A_Space%
   if (Param = &quot;&quot;)
          Break
   Arr := StrSplit(Param, &quot;,&quot;)
   Gui, Add, CheckBox, % &quot;x3 vState&quot; A_Index &quot; Checked&quot; Arr[1]
   Gui, Add, Edit, x+0 yp w100 Center vName%A_Index%, % Arr[2]
   Gui, Add, Edit, x+10 yp w150 vEmail%A_Index%, % Arr[3]
   Gui, Add, Edit, x+10 yp w100 vLog%A_Index%, % Arr[4]
}
Gui, Add, Button, x302 y+15 Cancel, Cancel
Gui, Add, Button, x+20, Save
Gui, Submit
Gui, Show
Return

GuiClose:
ButtonCancel:
ButtonSave:
   Gui, Hide
   If (A_ThisLabel = &quot;ButtonSave&quot;) {
      Gui, Submit
      Loop {
         if (State%A_Index% = &quot;&quot;)
            Break
         IniWrite, % State%A_Index% &quot;,&quot; Name%A_Index% &quot;,&quot; Email%A_Index% &quot;,&quot; Log%A_Index%
               , %IniFile%, Settings, Server%A_Index%
      }
   }
 
; остальной код
ListVars</code></pre></div><p>Test.ini</p><div class="codebox"><pre><code>[Settings]
Server1 =1,Ivan1,Ivan1@email,D:\1.txt
Server2 =1,Ivan3,Ivan3@email,D:\3.txt
Server3 =0,Ivan4,Ivan4@email,D:\4.txt
Server4 =1,Ivan7,Ivan7@email,D:\7.txt
Server5 =0,Ivan15,Ivan15@email,D:\15.txt
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2015-04-06T08:06:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93055#p93055</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм работы с плавующим количеством переменных]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93054#p93054" />
			<content type="html"><![CDATA[<p>Ну, если вы через гуй получили новое значение переменной, то почему его просто не присвоить этой переменной?</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2015-04-06T07:45:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93054#p93054</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм работы с плавующим количеством переменных]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93051#p93051" />
			<content type="html"><![CDATA[<p>А как по-другому? Я переменные считываю через #Include, test.txt.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-04-06T07:07:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93051#p93051</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм работы с плавующим количеством переменных]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93050#p93050" />
			<content type="html"><![CDATA[<p>А зачем перезагружать?</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2015-04-06T06:49:51Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93050#p93050</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм работы с плавующим количеством переменных]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93048#p93048" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Добавлять и стирать вручную - через ini-файл.</p></blockquote></div><p>Этот вариант не очень. Если уж делать, то все через гуи.<br />Написал я простыню взаимосвязи Гуи с базой данных. <br />При изменении параметров в Гуи, изменяю через регексы базу данных и перезагружаю скрипт.<br />Может есть проще(правильней) варианты?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-04-06T05:51:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93048#p93048</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм работы с плавующим количеством переменных]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93023#p93023" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>А как такой сделать, чтоб можно было добавлять, стирать блоки и временно их деактивировать (по типу базы данных)?</p></blockquote></div><p>Добавлять и стирать вручную - через ini-файл.<br />Скрипт при запуске считывает всю информацию&nbsp; из этого файла, определяет количество блоков и создаёт GUI с соответствующим числом флажков, типа такого:<br /></p><div class="codebox"><pre><code>GUI, Add, CheckBox, gCheck vServ1, Сервер 1
GUI, Add, CheckBox, gCheck vServ2, Сервер 2
GUI, Add, CheckBox, gCheck vServ3, Сервер 3
GUI, Show, w200 h200

Check:
GUI, Submit, NoHide</code></pre></div><p>Ну а дальше - смотря как у Вас происходит активация / деактивация.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2015-04-05T14:24:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93023#p93023</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм работы с плавующим количеством переменных]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93014#p93014" />
			<content type="html"><![CDATA[<p>Нумерация name%n% должна сохраняться , так как к каждому %n% будет приписываться свой файл лога.<br />То есть я хочу сделать что-то по типу базы данных, чтобы ненужные блоки можно было стирать и добавлять, а связь оставшихся с файлами их логов не терялась. В одну строчку написать хорошая идея.<br />txt<br /></p><div class="codebox"><pre><code>all := 0
n := 1, name%n% := &quot;ivan1&quot;, email%n% := &quot;emailIvan1&quot;, log%n% := &quot;D:\&quot; n &quot;.txt&quot;, all++
n := 2, name%n% := &quot;ivan3&quot;, email%n% := &quot;emailIvan3&quot;,  log%n% := &quot;D:\&quot; n &quot;.txt&quot;, all++
n := 3, name%n% := &quot;ivan4&quot;, email%n% := &quot;emailIvan4&quot;,  log%n% := &quot;D:\&quot; n &quot;.txt&quot;, all++</code></pre></div><p>ahk<br /></p><div class="codebox"><pre><code>#Include, test.txt
n := 0
loop % all
{
   n++
   while (name%n% = &quot;&quot;)
      n++
   msgbox % name%n% &quot; and &quot; email%n% &quot; and &quot; log%n%
}
</code></pre></div><div class="quotebox"><blockquote><p>Странно, что проще редактировать код, чем использовать GUI.</p></blockquote></div><p>А как такой сделать, чтоб можно было добавлять, стирать блоки и временно их деактивировать (по типу базы данных)?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-04-05T10:57:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93014#p93014</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм работы с плавующим количеством переменных]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93008#p93008" />
			<content type="html"><![CDATA[<p>Странно, что проще редактировать код, чем использовать GUI.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2015-04-05T06:46:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93008#p93008</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм работы с плавующим количеством переменных]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93007#p93007" />
			<content type="html"><![CDATA[<p>Да, об этом я не подумал. Ну, это дело тестера, он же аскер, отлавливать баги. <img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2015-04-05T06:03:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93007#p93007</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм работы с плавующим количеством переменных]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93006#p93006" />
			<content type="html"><![CDATA[<p>Так проще код, но для редактирования одной переменной надо рас(за)комментировать 4 строки в test.txt, и если пропустить хоть одну строку, нарушится хрупкая причинно-следственная связь. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />Начинать надо с данных, алгоритмы потом.</p><p><em>test.txt:</em></p><div class="codebox"><pre><code>n := 0
n++, name%n% := &quot;ivan1&quot;, email%n% := &quot;emailIvan1&quot;
n++, name%n% := &quot;ivan3&quot;, email%n% := &quot;emailIvan3&quot;
n++, name%n% := &quot;ivan4&quot;, email%n% := &quot;emailIvan4&quot;
</code></pre></div><p>И да, код тоже можно упростить.<br /></p><div class="codebox"><pre><code>#Include, %A_ScriptDir%\test.txt
Loop {
   if !name%A_Index%
      Break
   MsgBox % name%A_Index% &quot; : &quot; email%A_Index%
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2015-04-05T05:45:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93006#p93006</id>
		</entry>
</feed>
