<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sietoebie &#187; Bestanden</title>
	<atom:link href="http://www.sietoebie.be/tag/bestanden/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sietoebie.be</link>
	<description>Software solutions and questions blog</description>
	<lastBuildDate>Mon, 22 Mar 2010 11:39:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Werken met een inifile</title>
		<link>http://www.sietoebie.be/2008/10/31/werken-met-een-inifile/</link>
		<comments>http://www.sietoebie.be/2008/10/31/werken-met-een-inifile/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 14:20:08 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[Bestanden]]></category>
		<category><![CDATA[inifile]]></category>

		<guid isPermaLink="false">http://www.sietoebie.be/?p=84</guid>
		<description><![CDATA[In het &#8216;oude&#8217; visual basic werkte ik regelmatig met een inifile waarin veel settings stonden.
Omdat ik af en toe wel bezoek over de vloer krijg met als zoektermen visual basic6 of bestanden + visual basic geef ik hier graag de werkwijze weer om gegevens van en naar een inifile te schrijven.
Declaratie van functies:
Declare Function GetPrivateProfileString [...]]]></description>
			<content:encoded><![CDATA[<p>In het &#8216;oude&#8217; visual basic werkte ik regelmatig met een inifile waarin veel settings stonden.<br />
Omdat ik af en toe wel bezoek over de vloer krijg met als zoektermen visual basic6 of bestanden + visual basic geef ik hier graag de werkwijze weer om gegevens van en naar een inifile te schrijven.</p>
<p>Declaratie van functies:<br />
<code>Declare Function GetPrivateProfileString Lib "kernel32" Alias _<br />
                 "GetPrivateProfileStringA" (ByVal lpApplicationName _<br />
                 As String, ByVal lpKeyName As Any, ByVal lpDefault _<br />
                 As String, ByVal lpReturnedString As String, ByVal _<br />
                 nSize As Long, ByVal lpFileName As String) As Long<br />
Declare Function WritePrivateProfileString Lib "kernel32" Alias _<br />
                 "WritePrivateProfileStringA" (ByVal lpApplicationName _<br />
                 As String, ByVal lpKeyName As Any, ByVal lpString As Any, _<br />
                 ByVal lpFileName As String) As Long<br />
</code></p>
<p>Gegevens uit een inifile halen:<br />
<code><br />
Public Function sGetINI(sINIfile As String, sSection As String, sKey _<br />
                As String, sDefault As String) As String</p>
<p>    Dim sTemp As String * 256<br />
    Dim nLength As Integer</p>
<p>    sTemp = Space$(256)</p>
<p>    nLength = GetPrivateProfileString(sSection, sKey, sDefault, sTemp, _<br />
              255, sINIfile)<br />
    sGetINI = Left$(sTemp, nLength)</p>
<p>End Function</p>
<p></code></p>
<p>Gegevens naar een inifile schrijven<br />
<code>Public Sub writeINI(sINIfile As String, sSection As String, sKey _<br />
           As String, sValue As String)</p>
<p>    Dim n As Integer<br />
    Dim sTemp As String</p>
<p>    sTemp = sValue</p>
<p>    'Replace any CR/LF characters with spaces<br />
    For n = 1 To Len(sValue)<br />
        If Mid$(sValue, n, 1) = vbCr Or Mid$(sValue, n, 1) = vbLf _<br />
        Then Mid$(sValue, n) = " "<br />
    Next n</p>
<p>    n = WritePrivateProfileString(sSection, sKey, sTemp, sINIfile)</p>
<p>End Sub<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sietoebie.be/2008/10/31/werken-met-een-inifile/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
