<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBS: Как к переменной rs(6) объекта recordset прибавить число]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=5209&amp;type=atom" />
	<updated>2010-11-30T10:18:30Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=5209</id>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Как к переменной rs(6) объекта recordset прибавить число]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42338#p42338" />
			<content type="html"><![CDATA[<p>Решил таким способом<br /></p><div class="codebox"><pre><code>ANUMB=hex(rs1(6))
         SNUMB=6-Len(ANUMB)
         HNUMB=String(SNUMB, &quot;0&quot;)&amp;ANUMB
         rs2.Fields(&quot;CODEKEY&quot;).Value = trim(&quot;18&quot; &amp; HNUMB &amp; &quot;00000000&quot;)</code></pre></div><p>где 18 - это флаг, который ставится при наличии номера карты, HNUMB - сам номер карты в шестнадцатиричном формате, а 00000000 - зарезервированно на будущее.</p>]]></content>
			<author>
				<name><![CDATA[pavlikspb]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26447</uri>
			</author>
			<updated>2010-11-30T10:18:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42338#p42338</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Как к переменной rs(6) объекта recordset прибавить число]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42221#p42221" />
			<content type="html"><![CDATA[<p>Еще раз большое спасибо!!!</p>]]></content>
			<author>
				<name><![CDATA[pavlikspb]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26447</uri>
			</author>
			<updated>2010-11-25T10:49:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42221#p42221</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Как к переменной rs(6) объекта recordset прибавить число]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42220#p42220" />
			<content type="html"><![CDATA[<p>Все, разобрался, в базе куда их необходимо выгружать поле CODEKEY типа TINYBLOB, а само смещение уже превышало размер поля, поэтому и получалась ерунда, когда размер мещения убавил все заработало. А почему я изначательно пытался загрузить такое большое число - потому что ввел в заблуждение сам программный продукт, у него в окне информации выводится содержимое этого поля, но 32 бита он дописывает сам (видно заложено на будущее). В любом случае большое спасибо.</p>]]></content>
			<author>
				<name><![CDATA[pavlikspb]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26447</uri>
			</author>
			<updated>2010-11-25T10:48:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42220#p42220</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Как к переменной rs(6) объекта recordset прибавить число]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42200#p42200" />
			<content type="html"><![CDATA[<p>уточнение, результат должен быть наверное такой: <br />&quot;11000 &amp; Dec2Bin(rs1.Fields(&quot;FCARDNUM&quot;).Value) &amp; 0000 0000 0000 0000 0000 0000 0000 0000&quot;<br />?</p>]]></content>
			<author>
				<name><![CDATA[pavlikspb]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26447</uri>
			</author>
			<updated>2010-11-24T18:37:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42200#p42200</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Как к переменной rs(6) объекта recordset прибавить число]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42199#p42199" />
			<content type="html"><![CDATA[<p>сравнивая результаты одних и тех же карточек, но в разных системах получаем изменение, только в первых - 41 бите, а в остальны 40 нули так и остаются...</p>]]></content>
			<author>
				<name><![CDATA[pavlikspb]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26447</uri>
			</author>
			<updated>2010-11-24T18:22:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42199#p42199</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Как к переменной rs(6) объекта recordset прибавить число]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42198#p42198" />
			<content type="html"><![CDATA[<p>Есть старая система контроля доступа - поддерживает номер карты одним размером, ее решили обновить на новую, которая поддерживает номер карты большим размером. Вводить 10000 карточек вручную, еще учитывая все дополнительные поля да фотографии - убийство. Вот и возникла необходимость в этом скрипте. В принципе он все поля, кроме фотографий и номеров перебрасывает, а это уже не мало...</p>]]></content>
			<author>
				<name><![CDATA[pavlikspb]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26447</uri>
			</author>
			<updated>2010-11-24T18:08:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42198#p42198</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Как к переменной rs(6) объекта recordset прибавить число]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42190#p42190" />
			<content type="html"><![CDATA[<p>Я просто не догоняю, что за смещение нужно сделать, а самое главное - зачем ?<br />Смещение делается, как Вы уже догадались, в текстовом режиме. Это проще всего, сейчас надо определиться куда нужно сделать смещение, и какое.<br />Т.е. слева или с права будем добавлять, что добавлять, и в каком количестве...</p>]]></content>
			<author>
				<name><![CDATA[Евген]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25253</uri>
			</author>
			<updated>2010-11-24T17:33:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42190#p42190</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Как к переменной rs(6) объекта recordset прибавить число]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42185#p42185" />
			<content type="html"><![CDATA[<p>может это может как-то решить проблему:<br />если переводить выходное поле, то в двоичном виде мы получаем 101011011100011100110101, <br />а при добавлении смещения получаем&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1100010101101110001110011010100000000000000000000000000000000,<br />выходит, что мы можем добавлять смещение относительно&nbsp; первых 5 знаков, а нули просто дописывать, что-то я совсем запутался...</p>]]></content>
			<author>
				<name><![CDATA[pavlikspb]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26447</uri>
			</author>
			<updated>2010-11-24T17:15:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42185#p42185</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Как к переменной rs(6) объекта recordset прибавить число]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42182#p42182" />
			<content type="html"><![CDATA[<p>Преобразование в двоичное... (оба решения не мои !!!)<br />проверка выявила взаимную работоспособность !!!<br /></p><div class="codebox"><pre><code>msgbox bin2dec(dec2bin(135))</code></pre></div><p>но с такими числами <strong>1778296458317019339</strong> не работает <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" /><br /></p><div class="codebox"><pre><code>Function Dec2Bin(n)
Do Until n = 0
    If (n Mod 2) Then Dec2Bin = &quot;1&quot; &amp; Dec2Bin Else Dec2Bin = &quot;0&quot; &amp; Dec2Bin
    n = n \ 2
Loop
End Function</code></pre></div><p>и обратно, после смещения...<br /></p><div class="codebox"><pre><code>Function Bin2Dec(strBin)
  Dim intLen, intPos, intValue, strTemp, strValue
  intLen = Len(strBin)
  intPos = 1
  intValue = 0
  strTemp = strReverse(strBin)

  Do While intPos &lt;= intLen
    strValue = Mid(strTemp, intPos, 1)
    Select Case strValue
      Case &quot;0&quot;
      Case &quot;1&quot;
        If intPos = 1 Then
          intValue = intValue + 1
        Else
          intValue = intValue + (2 ^ (intPos - 1))
        End If 
      Case Else
        intValue = Empty
        Exit Do
    End Select 
    intPos = intPos + 1
  Loop

  Bin2Dec = intValue
End Function</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Евген]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25253</uri>
			</author>
			<updated>2010-11-24T16:50:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42182#p42182</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Как к переменной rs(6) объекта recordset прибавить число]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42176#p42176" />
			<content type="html"><![CDATA[<p>только как это реализовать?</p>]]></content>
			<author>
				<name><![CDATA[pavlikspb]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26447</uri>
			</author>
			<updated>2010-11-24T16:35:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42176#p42176</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Как к переменной rs(6) объекта recordset прибавить число]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42174#p42174" />
			<content type="html"><![CDATA[<p>входное число&nbsp; &nbsp; &nbsp;выходно число(ncdk)<br />5415622&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1,77829645832244E+18<br />5426246&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1,77829645832245E+18<br />5600614&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1,77829645832262E+18</p>]]></content>
			<author>
				<name><![CDATA[pavlikspb]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26447</uri>
			</author>
			<updated>2010-11-24T16:23:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42174#p42174</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Как к переменной rs(6) объекта recordset прибавить число]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42173#p42173" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>pavlikspb пишет:</cite><blockquote><p>Может поменять слагаемые местами - т.е. сначала преобразовать в двоичное число, а потом добавить двоичное смещение?</p></blockquote></div><p>Наверное этот путь будет правильным...</p><p>У меня сейчас напрашивается вопрос - с насколько большими числами может работать VBScript ?</p>]]></content>
			<author>
				<name><![CDATA[Евген]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25253</uri>
			</author>
			<updated>2010-11-24T16:18:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42173#p42173</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Как к переменной rs(6) объекта recordset прибавить число]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42172#p42172" />
			<content type="html"><![CDATA[<p>Когда ответ одинаковый, то результат всегда получается 3543267717139282230</p>]]></content>
			<author>
				<name><![CDATA[pavlikspb]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26447</uri>
			</author>
			<updated>2010-11-24T16:11:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42172#p42172</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Как к переменной rs(6) объекта recordset прибавить число]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42171#p42171" />
			<content type="html"><![CDATA[<p>а что выдало<br /></p><div class="codebox"><pre><code>Msgbox ncdk</code></pre></div><p>и какое было значение поля FCARDNUM</p>]]></content>
			<author>
				<name><![CDATA[Евген]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25253</uri>
			</author>
			<updated>2010-11-24T16:08:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42171#p42171</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Как к переменной rs(6) объекта recordset прибавить число]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42170#p42170" />
			<content type="html"><![CDATA[<p>без изменений...ответ опять одинаковый.<br />Если в поле подставлять не переменные, а целые числа, то результат выдает разный</p>]]></content>
			<author>
				<name><![CDATA[pavlikspb]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26447</uri>
			</author>
			<updated>2010-11-24T16:06:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42170#p42170</id>
		</entry>
</feed>
