<?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=49889&amp;view=findpost&amp;p=328015</guid>
        <pubDate>Tue, 30 Mar 2004 17:32:54 +0000</pubDate>
        <title>Как сделать условную компиляцию</title>
        <link>https://forum.sources.ru/index.php?showtopic=49889&amp;view=findpost&amp;p=328015</link>
        <description><![CDATA[Dufa: Хоть фича и старая, но я все-таки решил её выложить. Вы можете объявлять процедуры Windows API для 16- или 32-разрядных ОС (Только в VB4): <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">#If Win#32 then </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&#39; если 32-разрядная ОС </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Declare SomeApi.... </div><div class="code_line">#Else </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&#39; если запущена 16-разрядная ОС </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Declare SomeApi </div><div class="code_line">#End IF</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script>Эта же фича может работать не только с функциями Windows API, но и с Вашими собственными функциями: <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">#If Win32 Then </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Dim lRc&amp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;lRc&amp; = ReturnSomeNumber(35000) </div><div class="code_line">#Else </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Dim lRc% </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;lRc% = ReturnSomeNumber(30000) </div><div class="code_line">#End If </div><div class="code_line">&nbsp;</div><div class="code_line">#If Win32 Then </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Private Function ReturnSomeNumber_ </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(lVar&amp;) As Long </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ReturnSomeNumber = 399999 </div><div class="code_line">#Else </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Private Function ReturnSomeNumber_ </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(lVar%) As Integer </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ReturnSomeNumber = 30000 </div><div class="code_line">#End If </div><div class="code_line">&nbsp;</div><div class="code_line">End Function</div></ol></div></div></div></div>]]></description>
        <author>Dufa</author>
        <category>Среда VB, компилятор, отладчик, редактор</category>
      </item>
	
      </channel>
      </rss>
	