Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Markdown

Remember the Windows 3.1 Macro Recorder?

https://snipt.net/embed/a0ba010418a3217bcafc11d08348a3b0/
https://snipt.net/raw/a0ba010418a3217bcafc11d08348a3b0/
a0ba010418a3217bcafc11d08348a3b0
markdown
Markdown
3
2016-12-09T09:34:51
True
False
True
Jul 03, 2014 at 11:17 AM
/api/public/snipt/135664/
remember-the-windows-31-macro-recorder-2f655ebe
<p><a href="http://www.mjtnet.com/blog/2014/07/03/remember-the-macro-recorder-in-windows-3-1/">http://www.mjtnet.com/blog/2014/07/03/remember-the-macro-recorder-in-windows-3-1/</a></p> <p><img src="http://www.mjtnet.com/images/blog/win31-macro-recorder.gif" alt="Windows 3.1 Macro Recorder" title="Windows 3.1!" /></p>
macro, recorder

VB.net

create text file with VB

1
2
3
4
5
6
7
8
Sub LogInformation(LogMessage As String)
Const LogFileName As String = "C:\FOLDERNAME\TEXTFILE.LOG"
Dim FileNum As Integer
    FileNum = FreeFile ' next file number
    Open LogFileName For Append As #FileNum ' creates the file if it doesn't exist
    Print #FileNum, LogMessage ' write information at the end of the text file
    Close #FileNum ' close the file
End Sub
https://snipt.net/embed/d7d21acb1ad53106662dd0c15ca958d4/
https://snipt.net/raw/d7d21acb1ad53106662dd0c15ca958d4/
d7d21acb1ad53106662dd0c15ca958d4
vb.net
VB.net
8
2016-12-09T07:33:25
True
False
False
/api/public/snipt/30845/
create-text-file-with-vb
<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> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">Sub</span> <span class="nf">LogInformation</span><span class="p">(</span><span class="n">LogMessage</span> <span class="ow">As</span> <span class="kt">String</span><span class="p">)</span> </span><span id="L-2"><a name="L-2"></a><span class="k">Const</span> <span class="n">LogFileName</span> <span class="ow">As</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">&quot;C:\FOLDERNAME\TEXTFILE.LOG&quot;</span> </span><span id="L-3"><a name="L-3"></a><span class="k">Dim</span> <span class="n">FileNum</span> <span class="ow">As</span> <span class="kt">Integer</span> </span><span id="L-4"><a name="L-4"></a> <span class="n">FileNum</span> <span class="o">=</span> <span class="n">FreeFile</span> <span class="c">&#39; next file number</span> </span><span id="L-5"><a name="L-5"></a> <span class="n">Open</span> <span class="n">LogFileName</span> <span class="k">For</span> <span class="n">Append</span> <span class="ow">As</span> <span class="p">#</span><span class="n">FileNum</span> <span class="c">&#39; creates the file if it doesn&#39;t exist</span> </span><span id="L-6"><a name="L-6"></a> <span class="n">Print</span> <span class="p">#</span><span class="n">FileNum</span><span class="p">,</span> <span class="n">LogMessage</span> <span class="c">&#39; write information at the end of the text file</span> </span><span id="L-7"><a name="L-7"></a> <span class="n">Close</span> <span class="p">#</span><span class="n">FileNum</span> <span class="c">&#39; close the file</span> </span><span id="L-8"><a name="L-8"></a><span class="k">End</span> <span class="k">Sub</span> </span></pre></div> </td></tr></table>
excel, macro, vb
Copyrighted, illegal, or inappropriate content? Email [email protected].