Ho creato una classe con lo scopo di essere da ponte tra l'activity e il service che fanno parte dello stesso progetto. Lo scopo è quello di avere un canale di comunicazione senza CallSubDelayed
sembra però che attingano a file differenti. dove sbaglio?
'Class Setup
Sub Class_Globals
Dim Intere As Int
Dim Interi As Int
Dim Netver As Int
Dim Attiva As Int
Dim Status As String
Dim dbpath As String
Dim setupf As String
Dim List1 As List
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
Attiva = 1
Intere = 5
Interi = 1
Netver = 1
Status = "OK"
setupf = "kit16.txt"
dbpath = File.DirInternal
List1.Initialize
ReadConfig
End Sub
Sub WriteConfig
List1.Add(Attiva)
List1.Add(Intere)
List1.Add(Interi)
List1.Add(Netver)
List1.Add(Status)
File.WriteList(dbpath,setupf, List1)
End Sub
Sub ReadConfig
If File.Exists(dbpath, setupf) = False Then
WriteConfig
End If
List1 = File.ReadList(dbpath, setupf)
Attiva = List1.Get(0)
Intere = List1.Get(1)
Interi = List1.Get(2)
Netver = List1.Get(3)
Status = List1.Get(4)
End Sub
Sub WriteStatus(line As String)
Status = line
WriteConfig
End Sub
Sub ReadStatus As String
ReadConfig
Return Status
End Sub
sembra però che attingano a file differenti. dove sbaglio?
'Class Setup
Sub Class_Globals
Dim Intere As Int
Dim Interi As Int
Dim Netver As Int
Dim Attiva As Int
Dim Status As String
Dim dbpath As String
Dim setupf As String
Dim List1 As List
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
Attiva = 1
Intere = 5
Interi = 1
Netver = 1
Status = "OK"
setupf = "kit16.txt"
dbpath = File.DirInternal
List1.Initialize
ReadConfig
End Sub
Sub WriteConfig
List1.Add(Attiva)
List1.Add(Intere)
List1.Add(Interi)
List1.Add(Netver)
List1.Add(Status)
File.WriteList(dbpath,setupf, List1)
End Sub
Sub ReadConfig
If File.Exists(dbpath, setupf) = False Then
WriteConfig
End If
List1 = File.ReadList(dbpath, setupf)
Attiva = List1.Get(0)
Intere = List1.Get(1)
Interi = List1.Get(2)
Netver = List1.Get(3)
Status = List1.Get(4)
End Sub
Sub WriteStatus(line As String)
Status = line
WriteConfig
End Sub
Sub ReadStatus As String
ReadConfig
Return Status
End Sub