Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Property File Support


Homicidal Monkey
 Share

Recommended Posts

SE1.0 uses property files instead of ini files. This should bridge the gap by adding property file support to vb6.

```
Public Sub WriteProperty(ByVal file As String, ByVal sectionArray, ByVal value As String)
    Dim i As Long
    Dim Section As String
    If value = vbNullString Then value = none
    For i = 0 To UBound(sectionArray)
        If i > 0 Then
            Section = Section + "." + sectionArray(i)
        Else
            Section = sectionArray(i)
        End If
    Next i
    Call WriteINI("default", Section, value, file)
End Sub

``````
Public Function ReadProperty(ByVal file As String, ByRef sectionArray) As String
    Dim i  As Long
    Dim Section As String

    For i = 0 To UBound(sectionArray)
        If i > 0 Then
            Section = Section + "." + sectionArray(i)
        Else
            Section = sectionArray(i)
        End If
    Next i
    ReadProperty = ReadINI("default", Section, file, "")
End Function

``````
Dim sectionArray(0 to 2) as String
sectionArray(0) = "property"
sectionArray(1) = "subproperty"
sectionArray(2) = "subsubproperty"
call writeproperty(app.path & "\properties.prp", sectionArray, "this is the value")

```
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...