Not the most efficient code, but easy to understand. Just call read_cfg() with the name of the appropriate language i.e. read_cfg("french")
Sub read_cfg( lang as string )
Dim List1 As List
Dim thisline, thiskey, thisval As String
Dim epos As Int
Dim reader As TextReader
If File.Exists(File.DirDefaultExternal, lang & ".ini") Then
reader.Initialize(File.OpenInput(File.DirDefaultExternal, lang & ".ini"))
If reader.IsInitialized Then
List1 = reader.ReadList
For i = 0 To List1.Size - 1
thisline = List1.Get(i)
epos = thisline.indexof("=")
thiskey = thisline.SubString2(0,epos)
thisval = thisline.SubString2(epos+1, thisline.Length)
Select thiskey
Case "welcometext"
array(0) = thisval
Case "exittext"
array(1) = thisval
Case "usernametext"
array(2) = thisval
Case "passwordtext"
array(3) = thisval
End Select
Next
reader.Close
End If
Else
ToastMessageShow("Language file " & lang & "ini not found!", False)
End If
End Sub
Hope this helps....