Tom Linie mellem tags i INI fil
Hej eksperter.Jeg har dette modul til at læse og redigere INI filer med.
----------Start-----------
Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Function ReadINI(sSection As String, sKeyName As String) As String
On Local Error Resume Next
Dim sRet As String
sRet = String(255, Chr(0))
ReadINI = Left(sRet, GetPrivateProfileString(sSection, ByVal sKeyName, "", sRet, Len(sRet), App.Path & "\Settings.ini"))
End Function
Function WriteINI(sSection As String, sKeyName As String, sNewString As String) As Boolean
On Local Error Resume Next
Call WritePrivateProfileString(sSection, sKeyName, sNewString, App.Path & "\Settings.ini")
WriteINI = (Err.Number = 0)
End Function
----------Slut-----------
Hvis at man laver en ini fil med et par informationer vil den for eks. se sådan her ud.:
----------Start-----------
[Settings]
Server=10.0.0.2
[Visual]
PosX=2000
PosY=4000
----------Slut-----------
Det som jeg gerne ville have scriptet til er at smidde en tom linie ind imellem "Server=10.0.0.2" og "[Visual]" så det for eks. så sådan her ud:
----------Start-----------
[Settings]
Server=10.0.0.2
[Visual]
PosX=2000
PosY=4000
----------Slut-----------
Nogen der kan hjælpe mig med dette?
