<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3904958</guid>
        <pubDate>Thu, 30 May 2024 08:21:37 +0000</pubDate>
        <title>как собрать 4 байта в single</title>
        <link>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3904958</link>
        <description><![CDATA[Mikle: Попал за комп с VB.NET и вспомнил про топик. Если ещё актуально, новый проект, код формы:<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">Imports System.Runtime.InteropServices</div><div class="code_line">&nbsp;</div><div class="code_line">Public Class Form1</div><div class="code_line">&nbsp;&nbsp; &nbsp;Private Structure Bytes4</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Dim b0 As Byte</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Dim b1 As Byte</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Dim b2 As Byte</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Dim b3 As Byte</div><div class="code_line">&nbsp;&nbsp; &nbsp;End Structure</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;&#60;StructLayout(LayoutKind.Explicit)&#62; Private Structure SingleAnd4Bytes</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&#60;FieldOffset(0)&#62; Dim Bytes As Bytes4</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&#60;FieldOffset(0)&#62; Dim Float As Single</div><div class="code_line">&nbsp;&nbsp; &nbsp;End Structure</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Dim Test As SingleAnd4Bytes</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Test.Float = Val(InputBox(&quot;Input Float Value&quot;))</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;MsgBox(&quot;Bytes:&quot; &amp; Str(Test.Bytes.b0) &amp; Str(Test.Bytes.b1) &amp; Str(Test.Bytes.b2) &amp; Str(Test.Bytes.b3))</div><div class="code_line">&nbsp;&nbsp; &nbsp;End Sub</div><div class="code_line">End Class</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
<br>
Это разборка Single на байты. Точно так же работает и в обратную сторону - записываем в структуру нужные байты и читаем Single значение в поле Float.]]></description>
        <author>Mikle</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903940</guid>
        <pubDate>Mon, 06 May 2024 19:04:09 +0000</pubDate>
        <title>как собрать 4 байта в single</title>
        <link>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903940</link>
        <description><![CDATA[Gonarh: В любом ЯП есть конструкт &quot;сдвиг <s class='tag-s'>по фазе</s>битовый&quot;, схематично чтото типа<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">Private uint_iModZ As UInteger</div><div class="code_line">Private ModZ As Single</div><div class="code_line">Private ModZ1(3) As Byte</div><div class="code_line">uint_iModZ = ModZ1(0) &#60;&#60; 24 + ModZ1(1) &#60;&#60; 16 + ModZ1(2) &#60;&#60; 8 + ModZ1(3)</div><div class="code_line">ModZ = CType(uint_iModZ, Single)</div></ol></div></div></div></div>]]></description>
        <author>Gonarh</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903939</guid>
        <pubDate>Mon, 06 May 2024 17:59:14 +0000</pubDate>
        <title>как собрать 4 байта в single</title>
        <link>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903939</link>
        <description><![CDATA[Songrim: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=445321&view=findpost&p=3903896'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Mikle &#064; <time class="tag-quote__quoted-time" datetime="2024-05-06T09:00:32+00:00">06.05.24, 09:00</time></span><div class='quote '>У меня сейчас на компе не установлена VS, но в сети есть примеры, например:<br>
<a class='tag-url' href='https://www.vbforums.com/showthread.php?761623-RESOLVED-Structure-as-union-in-VB-NET-Is-this-declaration-valid' target='_blank'>https://www.vbforums.com/showthread.php?761...claration-valid</a></div></div><br>
не разобрался... Еще нашел в интернете описание класса BitConverter, вроде это подойдет, но я не могу его найти VS2012 Basic. Кто может подсказать как это сделать.]]></description>
        <author>Songrim</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903896</guid>
        <pubDate>Mon, 06 May 2024 09:00:32 +0000</pubDate>
        <title>как собрать 4 байта в single</title>
        <link>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903896</link>
        <description><![CDATA[Mikle: У меня сейчас на компе не установлена VS, но в сети есть примеры, например:<br>
<a class='tag-url' href='https://www.vbforums.com/showthread.php?761623-RESOLVED-Structure-as-union-in-VB-NET-Is-this-declaration-valid' target='_blank'>https://www.vbforums.com/showthread.php?761...claration-valid</a>]]></description>
        <author>Mikle</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903870</guid>
        <pubDate>Mon, 06 May 2024 05:18:55 +0000</pubDate>
        <title>как собрать 4 байта в single</title>
        <link>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903870</link>
        <description><![CDATA[Songrim: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=445321&view=findpost&p=3903868'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Mikle &#064; <time class="tag-quote__quoted-time" datetime="2024-05-06T04:40:32+00:00">06.05.24, 04:40</time></span><div class='quote '>В vb.net можно объединить single с четырёхбайтовым массивом в Union.</div></div><br>
А как это можно сделать? Хотелось бы увидеть примеры кода.]]></description>
        <author>Songrim</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903868</guid>
        <pubDate>Mon, 06 May 2024 04:40:32 +0000</pubDate>
        <title>как собрать 4 байта в single</title>
        <link>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903868</link>
        <description><![CDATA[Mikle: В vb.net можно объединить single с четырёхбайтовым массивом в Union.]]></description>
        <author>Mikle</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903867</guid>
        <pubDate>Sun, 05 May 2024 19:18:36 +0000</pubDate>
        <title>как собрать 4 байта в single</title>
        <link>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903867</link>
        <description><![CDATA[Songrim: Visual Studio 2012, Basic]]></description>
        <author>Songrim</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903866</guid>
        <pubDate>Sun, 05 May 2024 19:17:00 +0000</pubDate>
        <title>как собрать 4 байта в single</title>
        <link>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903866</link>
        <description><![CDATA[TheTrik: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=445321&view=findpost&p=3903865'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Songrim &#064; <time class="tag-quote__quoted-time" datetime="2024-05-05T19:12:54+00:00">05.05.24, 19:12</time></span><div class='quote '><div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=445321&view=findpost&p=3903864'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>TheTrik &#064; <time class="tag-quote__quoted-time" datetime="2024-05-05T19:04:38+00:00">05.05.24, 19:04</time></span><div class='quote '><div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">Public Declare Function GetMem4 Lib &quot;msvbvm60&quot; (ByRef pSrc As Any, ByRef pDst As Any) As Long</div></ol></div></div></div></div></div></div><br>
Выдает что AsAny в операторах Declare не подерживается</div></div><br>
Какой язык программирования?]]></description>
        <author>TheTrik</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903865</guid>
        <pubDate>Sun, 05 May 2024 19:12:54 +0000</pubDate>
        <title>как собрать 4 байта в single</title>
        <link>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903865</link>
        <description><![CDATA[Songrim: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=445321&view=findpost&p=3903864'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>TheTrik &#064; <time class="tag-quote__quoted-time" datetime="2024-05-05T19:04:38+00:00">05.05.24, 19:04</time></span><div class='quote '><div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">Public Declare Function GetMem4 Lib &quot;msvbvm60&quot; (ByRef pSrc As Any, ByRef pDst As Any) As Long</div></ol></div></div></div></div></div></div><br>
Выдает что AsAny в операторах Declare не подерживается]]></description>
        <author>Songrim</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903864</guid>
        <pubDate>Sun, 05 May 2024 19:04:38 +0000</pubDate>
        <title>как собрать 4 байта в single</title>
        <link>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903864</link>
        <description><![CDATA[TheTrik: <div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">Public Declare Function GetMem4 Lib &quot;msvbvm60&quot; (ByRef pSrc As Any, ByRef pDst As Any) As Long</div></ol></div></div></div></div>]]></description>
        <author>TheTrik</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903863</guid>
        <pubDate>Sun, 05 May 2024 17:55:10 +0000</pubDate>
        <title>как собрать 4 байта в single</title>
        <link>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903863</link>
        <description><![CDATA[Songrim: я попробовал вот таким образом.<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">Public Declare Function GetMem4 Lib &quot;msvbvm60&quot; (ByVal pSrc As Long, ByVal pDst As Long) As Long</div><div class="code_line">Private ModZ As Single</div><div class="code_line">Private ModZ1(3) As Byte</div><div class="code_line">GetMem4(ModZ1(0), ModZ)</div></ol></div></div></div></div><br>
<br>
Но выдает ошибку]]></description>
        <author>Songrim</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903862</guid>
        <pubDate>Sun, 05 May 2024 15:56:48 +0000</pubDate>
        <title>как собрать 4 байта в single</title>
        <link>https://forum.sources.ru/index.php?showtopic=445321&amp;view=findpost&amp;p=3903862</link>
        <description><![CDATA[Songrim: Здраствуйте&#33;<br>Кто может подсказать как собрать 4 байта которые передает прибор в одну переменную типа single в VBnet 2012? Так же нужно разделить переменную single на 4 байта.]]></description>
        <author>Songrim</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      </channel>
      </rss>
	