<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK:  Перенос переменной в массив с предобработкой]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=8828</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8828&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK:  Перенос переменной в массив с предобработкой».]]></description>
		<lastBuildDate>Sun, 27 Oct 2013 23:08:50 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK:  Перенос переменной в массив с предобработкой]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=76566#p76566</link>
			<description><![CDATA[<p>-del</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Sun, 27 Oct 2013 23:08:50 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=76566#p76566</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Перенос переменной в массив с предобработкой]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=76565#p76565</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Что за Output, и в чём её необычность?</p></blockquote></div><p> в&nbsp; AHK есть реализация <strong>stdout</strong>, но нет <strong>stdin</strong> - это его реализация.<br />У меня были трудности с командой <strong>netsh</strong> - она не выдавала результата, а просто выводила на экран, ну мне помогли и написали функцию.</p><p><span class="bbu"><strong>UPD</strong></span></p><p><strong>serzh82saratov</strong> Большое спасибо, все работает, так как нужно, ну на первый взгляд, надо проверить более тщательно.</p><p>P.S. Я уж посимвольную обработку начал делать <img src="//forum.script-coding.com/img/smilies/big_smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Sun, 27 Oct 2013 22:55:31 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=76565#p76565</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Перенос переменной в массив с предобработкой]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=76564#p76564</link>
			<description><![CDATA[<p>Навскидку так:<br /></p><div class="codebox"><pre><code>
str =
(
&quot;rfvsf se      scev &quot;&quot;


&quot;rf&quot;vsf  v &quot;&quot;


)
Arr := [], i := 0
Loop, parse, str, `r`n  
{ 
    Row := RegExReplace(A_LoopField, &quot;&quot;&quot;| |&quot; A_Tab)
    If Row is space 
        Continue
    Arr[++i] := Row 
}
Loop % Arr.maxindex()
    MsgBox,, % A_Index, % Arr[A_Index]
ExitApp
</code></pre></div><div class="quotebox"><blockquote><p>P.S. C обычными переменными всё получается, но с Output - проблема и в чём она я не могу понять.</p></blockquote></div><p>Что за Output, и в чём её необычность?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sun, 27 Oct 2013 22:36:00 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=76564#p76564</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Перенос переменной в массив с предобработкой]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=76563#p76563</link>
			<description><![CDATA[<p>Так, не будем про двойные кавычки, может быть я в одном из вариантов ошибся... бывает,&nbsp; извиняюсь.</p><p>Вот что мне нужно, каждую строчку (ограниченную последовательностью [Cr] [Lf])&nbsp; поместить в отдельный элемент массива, по следующему алгоритму.<br /></p><ol class="decimal"><li><p>Игнорировать пустые строки, те которые содержат только [Cr] [Lf]</p></li><li><p>Из каждой строки <strong>Output</strong>&nbsp; убрать [&quot;] [sps] [tab] [Cr] [Lf]</p></li><li><p>Каждую полученную строчку поместить в отдельный элемент массива</p></li></ol><p> Вроде всё просто и я это делал неоднократно, но тут не получается.</p><p>P.S. C обычными переменными всё получается, но с <strong>Output</strong> - проблема и в чём она я не могу понять.</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Sun, 27 Oct 2013 22:18:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=76563#p76563</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Перенос переменной в массив с предобработкой]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=76560#p76560</link>
			<description><![CDATA[<p>Где там двойные кавычки, какие именно пробелы? Ты же опытный участник форума. <br />Просто приведите конкретную переменную для обработку. И результат что в итоге куда по каким переменным надо рассовать.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sun, 27 Oct 2013 21:50:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=76560#p76560</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Перенос переменной в массив с предобработкой]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=76559#p76559</link>
			<description><![CDATA[<p>Ты про скриншот или про то, что у меня не получается?</p><p>Если второе, то там идут двойные кавычки и при простом копировании переменная в переменную всё ОК, а вот поместить в массив надо обработать, да и не нужны мне пробелы в массиве и остальное, нужен только чистый текст, но построчно, как на скриншоте.</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Sun, 27 Oct 2013 21:05:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=76559#p76559</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Перенос переменной в массив с предобработкой]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=76558#p76558</link>
			<description><![CDATA[<p>Ничего не ясно, в текстовом виде разве нельзя представить?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sun, 27 Oct 2013 20:55:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=76558#p76558</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Перенос переменной в массив с предобработкой]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=76557#p76557</link>
			<description><![CDATA[<p>Извиняюсь, забыл вставить, вот скриншот (это вывод одной перемененной Output в 3-ей строчке скрипта)</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Sun, 27 Oct 2013 20:29:41 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=76557#p76557</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Перенос переменной в массив с предобработкой]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=76556#p76556</link>
			<description><![CDATA[<p>Прочитав тему, проблемы непонял.<br />В таких случаях обычно приводят конкретный пример строки, и то что должно получится.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sun, 27 Oct 2013 20:08:40 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=76556#p76556</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Перенос переменной в массив с предобработкой]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=76554#p76554</link>
			<description><![CDATA[<p>Я до неё ещё не добрался, пока обычными средствами пытаюсь и я не понял как она работает - RegExMatch</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Sun, 27 Oct 2013 18:10:22 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=76554#p76554</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Перенос переменной в массив с предобработкой]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=76553#p76553</link>
			<description><![CDATA[<p>Ни к чему эта возня с массивами. Надо просто взять из текста то, что нужно, с помощью RegExMatch.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Sun, 27 Oct 2013 18:07:20 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=76553#p76553</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Перенос переменной в массив с предобработкой]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=76552#p76552</link>
			<description><![CDATA[<p>Я видимо там немного ошибся, по сути мне надо каждую строчку записать в массив убрав&nbsp; `&quot;, `r,&nbsp; `n и еще пробелы, а потом я этот массив обработаю и получу ещё один - результирующий.</p><p>Уже вариантов 5-7 написал, ну просто ступор какой то - ни один не делает то что мне нужно.</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Sun, 27 Oct 2013 18:02:59 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=76552#p76552</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Перенос переменной в массив с предобработкой]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=76550#p76550</link>
			<description><![CDATA[<div class="codebox"><pre><code>Output:=Output</code></pre></div><p>А смысл?</p><p>И зачем пошагово? Код какой-то запутанный. Какая конечная цель?<br /></p><div class="quotebox"><blockquote><p>удаляет из переменной Output символы `&quot;, `r,&nbsp; `n и они должны записаться в массив&nbsp; arOutput[]</p></blockquote></div><p>Символы `&quot;, `r,&nbsp; `n записывать в массив? Зачем?</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Sun, 27 Oct 2013 17:38:54 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=76550#p76550</guid>
		</item>
		<item>
			<title><![CDATA[AHK:  Перенос переменной в массив с предобработкой]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=76543#p76543</link>
			<description><![CDATA[<p>Есть скрипт</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>CmdLine := &quot;netsh interface ipv4 show addresses&quot;
ret := RunCon(CmdLine, 0, Output)
MsgBox, Код завершения: %ret%`r`n`r`nВывод:`r`n%Output%

vOutput:=strOutput:=&quot;&quot;,Output:=Output
StringSplit, strOutput, Output, `&quot;
Loop, %strOutput0%
   vOutput := vOutput strOutput%a_index%
   
;i:= InStr(vOutput, &quot;интерфейс&quot;)
;msgbox, %i%

Output:=vOutput, vOutput:=strOutput:=&quot;&quot; 
StringSplit, strOutput, Output, `r
Loop, %strOutput0%
   vOutput := vOutput strOutput%a_index%

Output:=vOutput, vOutput:=strOutput:=&quot;&quot;, arOutput[] := &quot;&quot;, i:=1
StringSplit, strOutput, Output, `n
Loop, %strOutput0%
  { 
   vOutput :=  strOutput%a_index%
   arOutput[i] := strOutput%a_index%
   a := vOutput
   b := arOutput[i]
   msgbox, %i%  %a%  %b%   
   i++
  }  
exit</code></pre></div></div></div><p> который пошагово удаляет из переменной <strong>Output</strong> символы <strong>`&quot;</strong>, <strong>`r</strong>,&nbsp; <strong>`n</strong>, а остальное построчно должно записаться в массив&nbsp; <strong>arOutput[] </strong>, но <strong>msgbox, %i%&nbsp; %a%&nbsp; %b% </strong>&nbsp; показывает что переменная <strong>b</strong> пустая.<br />Что я не так написал? <br />Вроде всё верно и нет ничего необычного, записи в массив не происходит.</p><p>P.S. Данный скрипт использует функцию <strong>RunCon()</strong> из поста <span class="bbu"><a href="http://forum.script-coding.com/viewtopic.php?pid=76524#p76524">№34</a></span> темы <span class="bbu"><a href="http://forum.script-coding.com/viewtopic.php?id=8812">AHK: Управлением сетевым адаптером</a></span></p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Sun, 27 Oct 2013 15:45:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=76543#p76543</guid>
		</item>
	</channel>
</rss>
