Tools Links Login

Read INI

Opens a INI-file and Get the value of ex: "Screensaver=" without using any system calls!!!

Original Author: Dan Einarsson

Inputs

x = ReadINI("screensaver", "c:windowssystem.ini")
'or what ever

Returns

the value of the keyname
in this ex it would be perhaps: screensav.exe

API Declarations

NONE that is why i posted it!!!

Code

Function ReadINI(keyname As String, filename As String) As String
Open filename For Input Access Read As 1
Do Until EOF(1)
  Line Input #1, stemp
    ipos = InStr(stemp, keyname & "=")
    If ipos Then
      strinnick = strinnick + stemp
      ifound = True
      Allofit$ = strinnick
      wow$ = Mid(Allofit$, Len(keyname) + 2)
      GetINI = wow$
      Close 1
      Exit Function
    End If
Loop
  Close 1
End Function
'Written by: Dan Einarsson

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 98 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.