Lostmymind
Banned
Is there a simpler way on breaking up an array from a reply from website?
Right now I go this route.
it does work but if the website changes or things get added then I have update the code. Is fine since it works but I would like it to auto change and add when there are changes to the website.
Here is the code…
any help would be great THANKS
Right now I go this route.
it does work but if the website changes or things get added then I have update the code. Is fine since it works but I would like it to auto change and add when there are changes to the website.
Here is the code…
B4X:
Dim HD As Float
If parser.Parents.IndexOf("DeviceTextResponse") > -1 Then
If Name = "DeviceText" Then
Device_txt.Text = Text.ToString
Job2.Download2("https://www.energysmartwaterheater.com:443/latestHistoryGet.php", _
Array As String("DeviceText", Device_txt.Text))
End If
Else If parser.Parents.IndexOf("TempResponse") > -1 Then
If Name = "SetPoint" Then
Temp_Txt.Text = Text.ToString
End If
If Name = "Units" Then
DegreesSign.Text = Text.ToString
If DegreesSign.Text = "C" Then
DegC = Temp_Txt.Text
DegF = DegC*9/5+32
Else If DegreesSign.Text= "F" Then
DegF = Temp_Txt.Text
DegC = (DegF-32)*5/9
End If
End If
If Name = "mode" Then
If Text.ToString = "Standard" Then
Standard_Btn.text = True
Else If Text.ToString = "Vacation" Then
Vacation_Btn.text = True
Else If Text.ToString = "EnergySmart" Then
EnergySmart_Btn.text = True
End If
End If
If Name = "Grid" Then
If Text.ToString = "Disabled" Then
Grid_on_btn.enabled = True
Grid_on_btn.Visible = True
Grid_off_btn.Enabled = False
Grid_off_btn.Visible= False
Else If Text.ToString = "Enabled" Then
Grid_on_btn.enabled = False
Grid_on_btn.Visible = False
Grid_off_btn.Enabled = True
Grid_off_btn.Visible= True
End If
End If
If Name = "LeakDetect" Then
LeakDetect_Txt.Text = Text.ToString
End If
If Name = "ModuleApi" Then
ModuleApi_Txt.Text = Text.ToString
End If
If Name = "ModFwVer" Then
ModFwVer_Txt.Text = Text.ToString
End If
If Name = "UpdateRate" Then
UpdateRate_Txt.Text = Text.ToString
End If
If Name = "HotWaterVol" Then
HotWaterVol_Txt.Text = Text.ToString
End If
If Name = "DryFire" Then
DryFire_Txt.Text = Text.ToString
End If
If Name = "ElementFail" Then
ElementFail_Txt.Text = Text.ToString
End If
If Name = "EcoError" Then
EcoError_Txt.Text = Text.ToString
End If
If Name = "SignalStrength" Then
SignalStrength_Txt.Text = Text.ToString
End If
If Name = "UpperTemp" Then
UpperTemp_Txt.Text = Text.ToString
End If
If Name = "LowerTemp" Then
LowerTemp_Txt.Text = Text.ToString
End If
If Name = "FaultCodes" Then
FaultCodes_Txt.Text = Text.ToString
End If
End If
any help would be great THANKS