snipt

Ctrl+h for KB shortcuts

VB.net

VB - Round

1
2
3
i = Int(x)		'immer abrunden
i = Round(x)	'auf- & abrunden auf die nächste Ganzzahl
i = -Int(-x)	'immer aufrunden
https://snipt.net/embed/f8cbdeb5849de1dba90329accc3b6fd9/
https://snipt.net/raw/f8cbdeb5849de1dba90329accc3b6fd9/
f8cbdeb5849de1dba90329accc3b6fd9
vb.net
VB.net
3
2016-09-21T18:46:55
True
False
False
Nov 07, 2012 at 07:29 PM
/api/public/snipt/49827/
vb-round
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="n">i</span> <span class="o">=</span> <span class="n">Int</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="c">&#39;immer abrunden</span> </span><span id="L-2"><a name="L-2"></a><span class="n">i</span> <span class="o">=</span> <span class="n">Round</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="c">&#39;auf- &amp; abrunden auf die nächste Ganzzahl</span> </span><span id="L-3"><a name="L-3"></a><span class="n">i</span> <span class="o">=</span> <span class="o">-</span><span class="n">Int</span><span class="p">(</span><span class="o">-</span><span class="n">x</span><span class="p">)</span> <span class="c">&#39;immer aufrunden</span> </span></pre></div> </td></tr></table>
math, vb

VB.net

VB – Get Input Parameter

Dim args() As String = Environment.GetCommandLineArgs(1).ToArray
Dim args() As String = Split(Command$(), ";")
https://snipt.net/embed/3e9bd85fc3f53c7b2c5e6f82bf7e0a0a/
https://snipt.net/raw/3e9bd85fc3f53c7b2c5e6f82bf7e0a0a/
3e9bd85fc3f53c7b2c5e6f82bf7e0a0a
vb.net
VB.net
2
2016-09-21T18:56:47
True
False
False
Oct 31, 2012 at 08:47 AM
/api/public/snipt/49234/
vb-get-input-parameter-1
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="k">Dim</span> <span class="n">args</span><span class="p">()</span> <span class="ow">As</span> <span class="kt">String</span> <span class="o">=</span> <span class="n">Environment</span><span class="p">.</span><span class="n">GetCommandLineArgs</span><span class="p">(</span><span class="mi">1</span><span class="p">).</span><span class="n">ToArray</span> </span><span id="L-2"><a name="L-2"></a><span class="k">Dim</span> <span class="n">args</span><span class="p">()</span> <span class="ow">As</span> <span class="kt">String</span> <span class="o">=</span> <span class="n">Split</span><span class="p">(</span><span class="n">Command$</span><span class="p">(),</span> <span class="s">&quot;;&quot;</span><span class="p">)</span> </span></pre></div> </td></tr></table>
input, vb

VB.net

VB – Aktuelle Kalenderwoche

1
2
3
4
Function KW(d As Date) As Integer
    t = DateSerial(Year(d + (8 - WeekDay(d)) Mod 7 - 3), 1, 1)
    KW = (d - t - 3 + (WeekDay(t) + 1) Mod 7) \ 7 + 1
End Function
https://snipt.net/embed/1f4cc7b55fa6d265352547115ac928ed/
https://snipt.net/raw/1f4cc7b55fa6d265352547115ac928ed/
1f4cc7b55fa6d265352547115ac928ed
vb.net
VB.net
4
2016-09-22T06:55:40
True
False
False
Oct 28, 2012 at 06:40 PM
/api/public/snipt/49227/
vb-aktuelle-kalenderwoche
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="k">Function</span> <span class="nf">KW</span><span class="p">(</span><span class="n">d</span> <span class="ow">As</span> <span class="kt">Date</span><span class="p">)</span> <span class="ow">As</span> <span class="kt">Integer</span> </span><span id="L-2"><a name="L-2"></a> <span class="n">t</span> <span class="o">=</span> <span class="n">DateSerial</span><span class="p">(</span><span class="n">Year</span><span class="p">(</span><span class="n">d</span> <span class="o">+</span> <span class="p">(</span><span class="mi">8</span> <span class="o">-</span> <span class="n">WeekDay</span><span class="p">(</span><span class="n">d</span><span class="p">))</span> <span class="ow">Mod</span> <span class="mi">7</span> <span class="o">-</span> <span class="mi">3</span><span class="p">),</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> </span><span id="L-3"><a name="L-3"></a> <span class="n">KW</span> <span class="o">=</span> <span class="p">(</span><span class="n">d</span> <span class="o">-</span> <span class="n">t</span> <span class="o">-</span> <span class="mi">3</span> <span class="o">+</span> <span class="p">(</span><span class="n">WeekDay</span><span class="p">(</span><span class="n">t</span><span class="p">)</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> <span class="ow">Mod</span> <span class="mi">7</span><span class="p">)</span> <span class="o">\</span> <span class="mi">7</span> <span class="o">+</span> <span class="mi">1</span> </span><span id="L-4"><a name="L-4"></a><span class="k">End</span> <span class="k">Function</span> </span></pre></div> </td></tr></table>
date, vb
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.