Android Question Trying to map a JSON entry error (SOLVED)

Colin Evans

Active Member
Licensed User
Longtime User
I'm trying to read a JSON file in but having problems understanding why I can't read the full data as I get an error the JSON is below, sorry is so long

  • location: Rhyl [Denbighshire;United Kingdom]
  • day
    • 1
      • date: 20200830
      • rain: 0
      • symbol_value: 2
      • uv_index_max: 4
      • snowline: 2400
      • symbol_description: Sunny intervals
      • symbol_description2: Sunny intervals
      • pressure: 1021
      • units
        • rain: mm
        • temp: °C
        • snowline: m
        • pressure: mb
        • wind: km/h
      • sun
        • in: 06:19
        • mid: 13:13
        • out: 20:07
      • tempmax: 15
      • local_time_offset: 1
      • moon
        • symbol: 12
        • in: 19:33
        • lumi: 92.37%
        • out: 02:32
        • desc: First Quarter, 92.37% Illuminated
      • month:
      • local_time: 20:09
      • hour
        • 0
          • rain: 0
          • temp: 11
          • symbol_value: 3
          • snowline: 2400
          • symbol_description: Cloudy
          • symbol_description2: Cloudy
          • pressure: 1019
          • clouds: 32%
          • uv_index: 0
          • symbol_value2: 3
          • humidity: 72
          • interval: 02:00
          • windchill: 11
          • wind
            • symbol: 10
            • gusts: 35
            • dir: NE
            • speed: 16
            • symbolB: 42
        • 1
          • rain: 0
          • temp: 12
          • symbol_value: 2
          • snowline: 2500
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1020
          • clouds: 19%
          • uv_index: 0
          • symbol_value2: 2
          • humidity: 74
          • interval: 05:00
          • windchill: 12
          • wind
            • symbol: 10
            • gusts: 29
            • dir: NE
            • speed: 12
            • symbolB: 42
        • 2
          • rain: 0
          • temp: 12
          • symbol_value: 2
          • snowline: 2700
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1020
          • clouds: 12%
          • uv_index: 1
          • symbol_value2: 2
          • humidity: 73
          • interval: 08:00
          • windchill: 12
          • wind
            • symbol: 10
            • gusts: 24
            • dir: NE
            • speed: 10
            • symbolB: 34
        • 3
          • rain: 0
          • temp: 14
          • symbol_value: 2
          • snowline: 2900
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1021
          • clouds: 30%
          • uv_index: 3
          • symbol_value2: 2
          • humidity: 65
          • interval: 11:00
          • windchill: 14
          • wind
            • symbol: 9
            • gusts: 24
            • dir: N
            • speed: 11
            • symbolB: 33
        • 4
          • rain: 0
          • temp: 14
          • symbol_value: 3
          • snowline: 3000
          • symbol_description: Cloudy
          • symbol_description2: Cloudy
          • pressure: 1021
          • clouds: 67%
          • uv_index: 3
          • symbol_value2: 3
          • humidity: 63
          • interval: 14:00
          • windchill: 14
          • wind
            • symbol: 9
            • gusts: 25
            • dir: N
            • speed: 11
            • symbolB: 33
        • 5
          • rain: 0
          • temp: 14
          • symbol_value: 3
          • snowline: 3200
          • symbol_description: Cloudy
          • symbol_description2: Cloudy
          • pressure: 1021
          • clouds: 66%
          • uv_index: 1
          • symbol_value2: 3
          • humidity: 70
          • interval: 17:00
          • windchill: 14
          • wind
            • symbol: 16
            • gusts: 25
            • dir: NW
            • speed: 9
            • symbolB: 40
        • 6
          • rain: 0
          • temp: 13
          • symbol_value: 2
          • snowline: 3300
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1021
          • clouds: 28%
          • uv_index: 0
          • symbol_value2: 2
          • humidity: 73
          • interval: 20:00
          • windchill: 13
          • wind
            • symbol: 7
            • gusts: 19
            • dir: W
            • speed: 4
            • symbolB: 31
        • 7
          • rain: 0
          • temp: 12
          • symbol_value: 2
          • snowline: 3200
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1022
          • clouds: 14%
          • uv_index: 0
          • symbol_value2: 2
          • humidity: 78
          • interval: 23:00
          • windchill: 12
          • wind
            • symbol: 6
            • gusts: 11
            • dir: SW
            • speed: 4
            • symbolB: 22
      • name: Sunday
      • symbol_value2: 2
      • humidity: 71
      • tempmin: 10
      • wind
        • symbol: 10
        • gusts: 38
        • speed: 16
        • symbolB: 42
    • 2
      • date: 20200831
      • rain: 0
      • symbol_value: 3
      • uv_index_max: 3
      • snowline: 3200
      • symbol_description: Cloudy
      • symbol_description2: Cloudy
      • pressure: 1021
      • units
        • rain: mm
        • temp: °C
        • snowline: m
        • pressure: mb
        • wind: km/h
      • sun
        • in: 06:21
        • mid: 13:13
        • out: 20:04
      • tempmax: 17
      • local_time_offset: 1
      • moon
        • symbol: 12
        • in: 20:00
        • lumi: 96.81%
        • out: 03:43
        • desc: First Quarter, 96.81% Illuminated
      • month:
      • local_time: 20:09
      • hour
        • 0
          • rain: 0
          • temp: 10
          • symbol_value: 2
          • snowline: 3300
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1021
          • clouds: 21%
          • uv_index: 0
          • symbol_value2: 2
          • humidity: 90
          • interval: 02:00
          • windchill: 9
          • wind
            • symbol: 5
            • gusts: 17
            • dir: S
            • speed: 9
            • symbolB: 29
        • 1
          • rain: 0
          • temp: 10
          • symbol_value: 2
          • snowline: 3300
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1021
          • clouds: 27%
          • uv_index: 0
          • symbol_value2: 2
          • humidity: 87
          • interval: 05:00
          • windchill: 8
          • wind
            • symbol: 13
            • gusts: 20
            • dir: S
            • speed: 10
            • symbolB: 37
        • 2
          • rain: 0
          • temp: 11
          • symbol_value: 2
          • snowline: 3300
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1022
          • clouds: 16%
          • uv_index: 1
          • symbol_value2: 2
          • humidity: 76
          • interval: 08:00
          • windchill: 11
          • wind
            • symbol: 13
            • gusts: 22
            • dir: S
            • speed: 10
            • symbolB: 37
        • 3
          • rain: 0
          • temp: 15
          • symbol_value: 3
          • snowline: 3400
          • symbol_description: Cloudy
          • symbol_description2: Cloudy
          • pressure: 1022
          • clouds: 33%
          • uv_index: 2
          • symbol_value2: 3
          • humidity: 62
          • interval: 11:00
          • windchill: 15
          • wind
            • symbol: 14
            • gusts: 20
            • dir: SW
            • speed: 3
            • symbolB: 38
        • 4
          • rain: 0
          • temp: 16
          • symbol_value: 4
          • snowline: 3600
          • symbol_description: Overcast
          • symbol_description2: Overcast
          • pressure: 1021
          • clouds: 94%
          • uv_index: 2
          • symbol_value2: 4
          • humidity: 59
          • interval: 14:00
          • windchill: 16
          • wind
            • symbol: 1
            • gusts: 16
            • dir: N
            • speed: 4
            • symbolB: 25
        • 5
          • rain: 0
          • temp: 16
          • symbol_value: 4
          • snowline: 3700
          • symbol_description: Overcast
          • symbol_description2: Overcast
          • pressure: 1021
          • clouds: 87%
          • uv_index: 1
          • symbol_value2: 4
          • humidity: 63
          • interval: 17:00
          • windchill: 16
          • wind
            • symbol: 2
            • gusts: 14
            • dir: NE
            • speed: 4
            • symbolB: 26
        • 6
          • rain: 0
          • temp: 15
          • symbol_value: 3
          • snowline: 3700
          • symbol_description: Cloudy
          • symbol_description2: Cloudy
          • pressure: 1020
          • clouds: 67%
          • uv_index: 0
          • symbol_value2: 3
          • humidity: 69
          • interval: 20:00
          • windchill: 15
          • wind
            • symbol: 4
            • gusts: 15
            • dir: SE
            • speed: 3
            • symbolB: 28
        • 7
          • rain: 0
          • temp: 14
          • symbol_value: 3
          • snowline: 3600
          • symbol_description: Cloudy
          • symbol_description2: Cloudy
          • pressure: 1021
          • clouds: 82%
          • uv_index: 0
          • symbol_value2: 3
          • humidity: 71
          • interval: 23:00
          • windchill: 14
          • wind
            • symbol: 6
            • gusts: 18
            • dir: SW
            • speed: 10
            • symbolB: 30
      • name: Monday
      • symbol_value2: 3
      • humidity: 72
      • tempmin: 9
      • wind
        • symbol: 13
        • gusts: 22
        • speed: 11
        • symbolB: 37
    • 3
      • date: 20200901
      • rain: 0
      • symbol_value: 3
      • uv_index_max: 2
      • snowline: 3400
      • symbol_description: Cloudy
      • symbol_description2: Cloudy
      • pressure: 1019
      • units
        • rain: mm
        • temp: °C
        • snowline: m
        • pressure: mb
        • wind: km/h
      • sun
        • in: 06:22
        • mid: 13:13
        • out: 20:02
      • tempmax: 18
      • local_time_offset: 1
      • moon
        • symbol: 13
        • in: 20:21
        • lumi: 99.27%
        • out: 04:57
        • desc: Full Moon, 99.27% Illuminated
      • month:
      • local_time: 20:09
      • hour
        • 0
          • rain: 0
          • temp: 14
          • symbol_value: 4
          • snowline: 3600
          • symbol_description: Overcast
          • symbol_description2: Overcast
          • pressure: 1021
          • clouds: 96%
          • uv_index: 0
          • symbol_value2: 4
          • humidity: 74
          • interval: 01:00
          • windchill: 14
          • wind
            • symbol: 5
            • gusts: 18
            • dir: S
            • speed: 8
            • symbolB: 29
        • 1
          • rain: 0
          • temp: 12
          • symbol_value: 2
          • snowline: 3600
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1020
          • clouds: 22%
          • uv_index: 0
          • symbol_value2: 2
          • humidity: 82
          • interval: 04:00
          • windchill: 12
          • wind
            • symbol: 5
            • gusts: 19
            • dir: S
            • speed: 10
            • symbolB: 29
        • 2
          • rain: 0
          • temp: 11
          • symbol_value: 2
          • snowline: 3600
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1020
          • clouds: 12%
          • uv_index: 0
          • symbol_value2: 2
          • humidity: 87
          • interval: 07:00
          • windchill: 11
          • wind
            • symbol: 13
            • gusts: 22
            • dir: S
            • speed: 12
            • symbolB: 37
        • 3
          • rain: 0
          • temp: 15
          • symbol_value: 1
          • snowline: 3600
          • symbol_description: Sunny
          • symbol_description2: Sunny
          • pressure: 1021
          • clouds: 9%
          • uv_index: 2
          • symbol_value2: 1
          • humidity: 66
          • interval: 10:00
          • windchill: 15
          • wind
            • symbol: 13
            • gusts: 23
            • dir: S
            • speed: 10
            • symbolB: 37
        • 4
          • rain: 0
          • temp: 18
          • symbol_value: 3
          • snowline: 3500
          • symbol_description: Cloudy
          • symbol_description2: Cloudy
          • pressure: 1020
          • clouds: 95%
          • uv_index: 2
          • symbol_value2: 3
          • humidity: 56
          • interval: 13:00
          • windchill: 18
          • wind
            • symbol: 14
            • gusts: 21
            • dir: SW
            • speed: 5
            • symbolB: 38
        • 5
          • rain: 0
          • temp: 17
          • symbol_value: 3
          • snowline: 3400
          • symbol_description: Cloudy
          • symbol_description2: Cloudy
          • pressure: 1019
          • clouds: 59%
          • uv_index: 2
          • symbol_value2: 3
          • humidity: 63
          • interval: 16:00
          • windchill: 17
          • wind
            • symbol: 2
            • gusts: 19
            • dir: NE
            • speed: 3
            • symbolB: 26
        • 6
          • rain: 0
          • temp: 17
          • symbol_value: 2
          • snowline: 3700
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1018
          • clouds: 11%
          • uv_index: 0
          • symbol_value2: 2
          • humidity: 70
          • interval: 19:00
          • windchill: 17
          • wind
            • symbol: 4
            • gusts: 16
            • dir: SE
            • speed: 4
            • symbolB: 28
        • 7
          • rain: 0
          • temp: 14
          • symbol_value: 2
          • snowline: 3900
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1018
          • clouds: 17%
          • uv_index: 0
          • symbol_value2: 2
          • humidity: 79
          • interval: 22:00
          • windchill: 14
          • wind
            • symbol: 5
            • gusts: 19
            • dir: S
            • speed: 11
            • symbolB: 29
      • name: Tuesday
      • symbol_value2: 3
      • humidity: 72
      • tempmin: 11
      • wind
        • symbol: 13
        • gusts: 23
        • speed: 12
        • symbolB: 37
    • 4
      • date: 20200902
      • rain: 9.1
      • symbol_value: 9
      • uv_index_max: 3
      • snowline: 3900
      • symbol_description: Cloudy with heavy rain shower
      • symbol_description2: Cloudy with heavy rain shower
      • pressure: 1013
      • units
        • rain: mm
        • temp: °C
        • snowline: m
        • pressure: mb
        • wind: km/h
      • sun
        • in: 06:24
        • mid: 13:12
        • out: 20:00
      • tempmax: 18
      • local_time_offset: 1
      • moon
        • symbol: 14
        • in: 20:38
        • lumi: 99.77%
        • out: 06:10
        • desc: Full Moon, 99.77% Illuminated
      • month:
      • local_time: 20:09
      • hour
        • 0
          • rain: 0
          • temp: 14
          • symbol_value: 2
          • snowline: 3900
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1018
          • clouds: 16%
          • uv_index: 0
          • symbol_value2: 2
          • humidity: 75
          • interval: 01:00
          • windchill: 14
          • wind
            • symbol: 13
            • gusts: 25
            • dir: S
            • speed: 13
            • symbolB: 37
        • 1
          • rain: 0
          • temp: 13
          • symbol_value: 2
          • snowline: 4100
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1016
          • clouds: 33%
          • uv_index: 0
          • symbol_value2: 2
          • humidity: 83
          • interval: 04:00
          • windchill: 13
          • wind
            • symbol: 13
            • gusts: 28
            • dir: S
            • speed: 15
            • symbolB: 37
        • 2
          • rain: 0
          • temp: 13
          • symbol_value: 2
          • snowline: 4100
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1016
          • clouds: 39%
          • uv_index: 0
          • symbol_value2: 2
          • humidity: 84
          • interval: 07:00
          • windchill: 13
          • wind
            • symbol: 13
            • gusts: 29
            • dir: S
            • speed: 16
            • symbolB: 45
        • 3
          • rain: 0
          • temp: 17
          • symbol_value: 2
          • snowline: 4100
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1014
          • clouds: 55%
          • uv_index: 2
          • symbol_value2: 2
          • humidity: 73
          • interval: 10:00
          • windchill: 17
          • wind
            • symbol: 13
            • gusts: 44
            • dir: S
            • speed: 23
            • symbolB: 53
        • 4
          • rain: 2
          • temp: 17
          • symbol_value: 7
          • snowline: 4000
          • symbol_description: Overcast with light rain
          • symbol_description2: Overcast with light rain
          • pressure: 1013
          • clouds: 100%
          • uv_index: 3
          • symbol_value2: 7
          • humidity: 83
          • interval: 13:00
          • windchill: 17
          • wind
            • symbol: 13
            • gusts: 47
            • dir: S
            • speed: 21
            • symbolB: 53
        • 5
          • rain: 4.2
          • temp: 16
          • symbol_value: 9
          • snowline: 4100
          • symbol_description: Cloudy with heavy rain shower
          • symbol_description2: Cloudy with heavy rain shower
          • pressure: 1011
          • clouds: 95%
          • uv_index: 2
          • symbol_value2: 9
          • humidity: 86
          • interval: 16:00
          • windchill: 16
          • wind
            • symbol: 13
            • gusts: 45
            • dir: S
            • speed: 24
            • symbolB: 53
        • 6
          • rain: 1.4
          • temp: 17
          • symbol_value: 6
          • snowline: 4100
          • symbol_description: Cloudy with light rain shower
          • symbol_description2: Cloudy with light rain shower
          • pressure: 1010
          • clouds: 74%
          • uv_index: 0
          • symbol_value2: 6
          • humidity: 85
          • interval: 19:00
          • windchill: 17
          • wind
            • symbol: 13
            • gusts: 46
            • dir: S
            • speed: 23
            • symbolB: 53
        • 7
          • rain: 1.5
          • temp: 17
          • symbol_value: 6
          • snowline: 4100
          • symbol_description: Cloudy with light rain shower
          • symbol_description2: Cloudy with light rain shower
          • pressure: 1010
          • clouds: 87%
          • uv_index: 0
          • symbol_value2: 6
          • humidity: 87
          • interval: 22:00
          • windchill: 17
          • wind
            • symbol: 13
            • gusts: 45
            • dir: S
            • speed: 20
            • symbolB: 53
      • name: Wednesday
      • symbol_value2: 9
      • humidity: 82
      • tempmin: 13
      • wind
        • symbol: 13
        • gusts: 47
        • speed: 24
        • symbolB: 53
    • 5
      • date: 20200903
      • rain: 1.3
      • symbol_value: 6
      • uv_index_max: 4
      • snowline: 3500
      • symbol_description: Cloudy with light rain shower
      • symbol_description2: Cloudy with light rain shower
      • pressure: 1012
      • units
        • rain: mm
        • temp: °C
        • snowline: m
        • pressure: mb
        • wind: km/h
      • sun
        • in: 06:26
        • mid: 13:12
        • out: 19:57
      • tempmax: 19
      • local_time_offset: 1
      • moon
        • symbol: 15
        • in: 20:53
        • lumi: 98.36%
        • out: 07:21
        • desc: Full Moon, 98.36% Illuminated
      • month:
      • local_time: 20:09
      • hour
        • 0
          • rain: 0.8
          • temp: 18
          • symbol_value: 6
          • snowline: 4200
          • symbol_description: Cloudy with light rain shower
          • symbol_description2: Cloudy with light rain shower
          • pressure: 1010
          • clouds: 67%
          • uv_index: 0
          • symbol_value2: 6
          • humidity: 88
          • interval: 01:00
          • windchill: 18
          • wind
            • symbol: 14
            • gusts: 38
            • dir: SW
            • speed: 17
            • symbolB: 46
        • 1
          • rain: 0.2
          • temp: 17
          • symbol_value: 6
          • snowline: 4100
          • symbol_description: Cloudy with light rain shower
          • symbol_description2: Cloudy with light rain shower
          • pressure: 1010
          • clouds: 91%
          • uv_index: 0
          • symbol_value2: 6
          • humidity: 91
          • interval: 04:00
          • windchill: 17
          • wind
            • symbol: 15
            • gusts: 31
            • dir: W
            • speed: 14
            • symbolB: 47
        • 2
          • rain: 0
          • temp: 16
          • symbol_value: 2
          • snowline: 3900
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1011
          • clouds: 43%
          • uv_index: 0
          • symbol_value2: 2
          • humidity: 91
          • interval: 07:00
          • windchill: 16
          • wind
            • symbol: 14
            • gusts: 24
            • dir: SW
            • speed: 13
            • symbolB: 38
        • 3
          • rain: 0
          • temp: 17
          • symbol_value: 2
          • snowline: 4000
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1012
          • clouds: 26%
          • uv_index: 2
          • symbol_value2: 2
          • humidity: 77
          • interval: 10:00
          • windchill: 17
          • wind
            • symbol: 14
            • gusts: 36
            • dir: SW
            • speed: 20
            • symbolB: 46
        • 4
          • rain: 0
          • temp: 19
          • symbol_value: 2
          • snowline: 3900
          • symbol_description: Sunny intervals
          • symbol_description2: Sunny intervals
          • pressure: 1013
          • clouds: 46%
          • uv_index: 4
          • symbol_value2: 2
          • humidity: 66
          • interval: 13:00
          • windchill: 19
          • wind
            • symbol: 14
            • gusts: 43
            • dir: SW
            • speed: 22
            • symbolB: 54
        • 5
          • rain: 0.3
          • temp: 19
          • symbol_value: 5
          • snowline: 3700
          • symbol_description: Sunny intervals with light rain shower
          • symbol_description2: Sunny intervals with light rain shower
          • pressure: 1013
          • clouds: 44%
          • uv_index: 2
          • symbol_value2: 5
          • humidity: 69
          • interval: 16:00
          • windchill: 19
          • wind
            • symbol: 15
            • gusts: 42
            • dir: W
            • speed: 18
            • symbolB: 55
        • 6
          • rain: 0
          • temp: 17
          • symbol_value: 3
          • snowline: 3500
          • symbol_description: Cloudy
          • symbol_description2: Cloudy
          • pressure: 1014
          • clouds: 61%
          • uv_index: 0
          • symbol_value2: 3
          • humidity: 78
          • interval: 19:00
          • windchill: 17
          • wind
            • symbol: 14
            • gusts: 33
            • dir: SW
            • speed: 17
            • symbolB: 46
        • 7
          • rain: 0
          • temp: 16
          • symbol_value: 3
          • snowline: 3600
          • symbol_description: Cloudy
          • symbol_description2: Cloudy
          • pressure: 1016
          • clouds: 91%
          • uv_index: 0
          • symbol_value2: 3
          • humidity: 86
          • interval: 22:00
          • windchill: 16
          • wind
            • symbol: 14
            • gusts: 32
            • dir: SW
            • speed: 16
            • symbolB: 46
      • name: Thursday
      • symbol_value2: 6
      • humidity: 80
      • tempmin: 16
      • wind
        • symbol: 14
        • gusts: 44
        • speed: 22
        • symbolB: 54
  • url: https://www.yourweather.co.uk/weather_Rhyl-Europe-United+Kingdom-Denbighshire--1-34671.html
  • status: 0

but if I try a For I = 1 to 5 I can't read the last day entry, and if I manually Map to 5 I get the same error,
i.e.
B4X:
Dim i As Int
        i = 5
        Dim strI As String = i
        Dim d1 As Map = day.Get(strI)
        date(i) = d1.Get("date")
        description(i) = d1.Get("symbol_description")
        rain(i) = d1.Get("rain")
       ''''''' etc

Why ?

error

main$ResumableSub_Downloadresume (java line: 859)
java.lang.ArrayIndexOutOfBoundsException: length=5; index=5

And it's the same when trying to get the data from Hour 0 to 7, if I do a For y = 0 to 6 it's okay but try For y = 0 to 7 and I get a similar error
 
Last edited:

mcqueccu

Well-Known Member
Licensed User
Longtime User
1. Put the long JSON string in SPOILER to make the thread short
2. What is the Direct link to the JSON file?

You can paste your JSON data into this B4X tool and it will generate the needed code to you to access all elements
 
Upvote 0

Colin Evans

Active Member
Licensed User
Longtime User
I have used the B4X tool to parse the JSON return and utilised most of the code offered but when I try and use it to map the days I get syntax errors if I try and map using the code given
B4X:
Dim 5 As Map = day.Get("5")
Dim date As String = 5.Get("date")
Dim rain As String = 5.Get("rain")
Dim symbol_value As String = 5.Get("symbol_value")
Dim uv_index_max As String = 5.Get("uv_index_max") 
etc

If I use a for next loop for i = 1 to 4 it works fine but if I enter for i = 1 to 5 as shown in the example snapshot of code, I get the following error
B4X:
Dim i As Int
        For i = 1 To 5 
            Dim strI As String = i
            Log("StrI: " & strI)
            Dim d1 As Map = day.Get(strI)
            date(i) = d1.Get("date")

StrI: 5
main$ResumableSub_Downloadresume (java line: 774)
java.lang.ArrayIndexOutOfBoundsException: length=5; index=5
at ditl.weather.main$ResumableSub_Download.resume(main.java:774)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:267)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:207)
at anywheresoftware.b4a.keywords.Common$11.run(Common.java:1178)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7397)
at java.lang.reflect.Method.invoke(Native Method)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Colin Evans

Active Member
Licensed User
Longtime User
Thanks for taking the time to reply,, 'toby' I do change i = 5 to a string srtI, the code that returns in the B4X parse tool does use numeric but I realised that wouldn't work, and DonManfred the days are 1 to 5 but the hours for each day are split into 3hourly hence 0 to 7, as I said I can get all the data for 1 to 4 and 0 to 6 but can't get the last entry for the day and hour ( 5 and 7 )

the html to get the data is
B4X:
http://api.yourweather.co.uk/index.php?api_lang=en&localidad=34671&affiliate_id=ollylklc8299&v=3.0

If anyone can help I'd greatly appreciate it, thanks
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
the html to get the data is
B4X:
Dim parser As JSONParser
parser.Initialize(<text>)
Dim root As Map = parser.NextObject
Dim location As String = root.Get("location")
Dim day As Map = root.Get("day")
Dim 1 As Map = day.Get("1")
Dim date As String = 1.Get("date")
Dim rain As String = 1.Get("rain")
Dim symbol_value As String = 1.Get("symbol_value")
Dim uv_index_max As String = 1.Get("uv_index_max")
Dim snowline As String = 1.Get("snowline")
Dim symbol_description As String = 1.Get("symbol_description")
Dim symbol_description2 As String = 1.Get("symbol_description2")
Dim pressure As String = 1.Get("pressure")
Dim units As Map = 1.Get("units")
Dim rain As String = units.Get("rain")
Dim temp As String = units.Get("temp")
Dim snowline As String = units.Get("snowline")
Dim pressure As String = units.Get("pressure")
Dim wind As String = units.Get("wind")
Dim sun As Map = 1.Get("sun")
Dim in As String = sun.Get("in")
Dim mid As String = sun.Get("mid")
Dim out As String = sun.Get("out")
Dim tempmax As String = 1.Get("tempmax")
Dim local_time_offset As Int = 1.Get("local_time_offset")
Dim moon As Map = 1.Get("moon")
Dim symbol As String = moon.Get("symbol")
Dim in As String = moon.Get("in")
Dim lumi As String = moon.Get("lumi")
Dim out As String = moon.Get("out")
Dim desc As String = moon.Get("desc")
Dim month As String = 1.Get("month")
Dim local_time As String = 1.Get("local_time")
Dim hour As List = 1.Get("hour")
For Each colhour As Map In hour
 Dim rain As String = colhour.Get("rain")
 Dim temp As String = colhour.Get("temp")
 Dim symbol_value As String = colhour.Get("symbol_value")
 Dim snowline As String = colhour.Get("snowline")
 Dim symbol_description As String = colhour.Get("symbol_description")
 Dim symbol_description2 As String = colhour.Get("symbol_description2")
 Dim pressure As String = colhour.Get("pressure")
 Dim clouds As String = colhour.Get("clouds")
 Dim uv_index As String = colhour.Get("uv_index")
 Dim symbol_value2 As String = colhour.Get("symbol_value2")
 Dim humidity As String = colhour.Get("humidity")
 Dim interval As String = colhour.Get("interval")
 Dim windchill As String = colhour.Get("windchill")
 Dim wind As Map = colhour.Get("wind")
 Dim symbol As String = wind.Get("symbol")
 Dim gusts As String = wind.Get("gusts")
 Dim dir As String = wind.Get("dir")
 Dim speed As String = wind.Get("speed")
 Dim symbolB As String = wind.Get("symbolB")
Next
Dim name As String = 1.Get("name")
Dim symbol_value2 As String = 1.Get("symbol_value2")
Dim humidity As String = 1.Get("humidity")
Dim tempmin As String = 1.Get("tempmin")
Dim wind As Map = 1.Get("wind")
Dim symbol As String = wind.Get("symbol")
Dim gusts As String = wind.Get("gusts")
Dim speed As String = wind.Get("speed")
Dim symbolB As String = wind.Get("symbolB")
Dim 2 As Map = day.Get("2")
Dim date As String = 2.Get("date")
Dim rain As String = 2.Get("rain")
Dim symbol_value As String = 2.Get("symbol_value")
Dim uv_index_max As String = 2.Get("uv_index_max")
Dim snowline As String = 2.Get("snowline")
Dim symbol_description As String = 2.Get("symbol_description")
Dim symbol_description2 As String = 2.Get("symbol_description2")
Dim pressure As String = 2.Get("pressure")
Dim units As Map = 2.Get("units")
Dim rain As String = units.Get("rain")
Dim temp As String = units.Get("temp")
Dim snowline As String = units.Get("snowline")
Dim pressure As String = units.Get("pressure")
Dim wind As String = units.Get("wind")
Dim sun As Map = 2.Get("sun")
Dim in As String = sun.Get("in")
Dim mid As String = sun.Get("mid")
Dim out As String = sun.Get("out")
Dim tempmax As String = 2.Get("tempmax")
Dim local_time_offset As Int = 2.Get("local_time_offset")
Dim moon As Map = 2.Get("moon")
Dim symbol As String = moon.Get("symbol")
Dim in As String = moon.Get("in")
Dim lumi As String = moon.Get("lumi")
Dim out As String = moon.Get("out")
Dim desc As String = moon.Get("desc")
Dim month As String = 2.Get("month")
Dim local_time As String = 2.Get("local_time")
Dim hour As List = 2.Get("hour")
For Each colhour As Map In hour
 Dim rain As String = colhour.Get("rain")
 Dim temp As String = colhour.Get("temp")
 Dim symbol_value As String = colhour.Get("symbol_value")
 Dim snowline As String = colhour.Get("snowline")
 Dim symbol_description As String = colhour.Get("symbol_description")
 Dim symbol_description2 As String = colhour.Get("symbol_description2")
 Dim pressure As String = colhour.Get("pressure")
 Dim clouds As String = colhour.Get("clouds")
 Dim uv_index As String = colhour.Get("uv_index")
 Dim symbol_value2 As String = colhour.Get("symbol_value2")
 Dim humidity As String = colhour.Get("humidity")
 Dim interval As String = colhour.Get("interval")
 Dim windchill As String = colhour.Get("windchill")
 Dim wind As Map = colhour.Get("wind")
 Dim symbol As String = wind.Get("symbol")
 Dim gusts As String = wind.Get("gusts")
 Dim dir As String = wind.Get("dir")
 Dim speed As String = wind.Get("speed")
 Dim symbolB As String = wind.Get("symbolB")
Next
Dim name As String = 2.Get("name")
Dim symbol_value2 As String = 2.Get("symbol_value2")
Dim humidity As String = 2.Get("humidity")
Dim tempmin As String = 2.Get("tempmin")
Dim wind As Map = 2.Get("wind")
Dim symbol As String = wind.Get("symbol")
Dim gusts As String = wind.Get("gusts")
Dim speed As String = wind.Get("speed")
Dim symbolB As String = wind.Get("symbolB")
Dim 3 As Map = day.Get("3")
Dim date As String = 3.Get("date")
Dim rain As String = 3.Get("rain")
Dim symbol_value As String = 3.Get("symbol_value")
Dim uv_index_max As String = 3.Get("uv_index_max")
Dim snowline As String = 3.Get("snowline")
Dim symbol_description As String = 3.Get("symbol_description")
Dim symbol_description2 As String = 3.Get("symbol_description2")
Dim pressure As String = 3.Get("pressure")
Dim units As Map = 3.Get("units")
Dim rain As String = units.Get("rain")
Dim temp As String = units.Get("temp")
Dim snowline As String = units.Get("snowline")
Dim pressure As String = units.Get("pressure")
Dim wind As String = units.Get("wind")
Dim sun As Map = 3.Get("sun")
Dim in As String = sun.Get("in")
Dim mid As String = sun.Get("mid")
Dim out As String = sun.Get("out")
Dim tempmax As String = 3.Get("tempmax")
Dim local_time_offset As Int = 3.Get("local_time_offset")
Dim moon As Map = 3.Get("moon")
Dim symbol As String = moon.Get("symbol")
Dim in As String = moon.Get("in")
Dim lumi As String = moon.Get("lumi")
Dim out As String = moon.Get("out")
Dim desc As String = moon.Get("desc")
Dim month As String = 3.Get("month")
Dim local_time As String = 3.Get("local_time")
Dim hour As List = 3.Get("hour")
For Each colhour As Map In hour
 Dim rain As String = colhour.Get("rain")
 Dim temp As String = colhour.Get("temp")
 Dim symbol_value As String = colhour.Get("symbol_value")
 Dim snowline As String = colhour.Get("snowline")
 Dim symbol_description As String = colhour.Get("symbol_description")
 Dim symbol_description2 As String = colhour.Get("symbol_description2")
 Dim pressure As String = colhour.Get("pressure")
 Dim clouds As String = colhour.Get("clouds")
 Dim uv_index As String = colhour.Get("uv_index")
 Dim symbol_value2 As String = colhour.Get("symbol_value2")
 Dim humidity As String = colhour.Get("humidity")
 Dim interval As String = colhour.Get("interval")
 Dim windchill As String = colhour.Get("windchill")
 Dim wind As Map = colhour.Get("wind")
 Dim symbol As String = wind.Get("symbol")
 Dim gusts As String = wind.Get("gusts")
 Dim dir As String = wind.Get("dir")
 Dim speed As String = wind.Get("speed")
 Dim symbolB As String = wind.Get("symbolB")
Next
Dim name As String = 3.Get("name")
Dim symbol_value2 As String = 3.Get("symbol_value2")
Dim humidity As String = 3.Get("humidity")
Dim tempmin As String = 3.Get("tempmin")
Dim wind As Map = 3.Get("wind")
Dim symbol As String = wind.Get("symbol")
Dim gusts As String = wind.Get("gusts")
Dim speed As String = wind.Get("speed")
Dim symbolB As String = wind.Get("symbolB")
Dim 4 As Map = day.Get("4")
Dim date As String = 4.Get("date")
Dim rain As String = 4.Get("rain")
Dim symbol_value As String = 4.Get("symbol_value")
Dim uv_index_max As String = 4.Get("uv_index_max")
Dim snowline As String = 4.Get("snowline")
Dim symbol_description As String = 4.Get("symbol_description")
Dim symbol_description2 As String = 4.Get("symbol_description2")
Dim pressure As String = 4.Get("pressure")
Dim units As Map = 4.Get("units")
Dim rain As String = units.Get("rain")
Dim temp As String = units.Get("temp")
Dim snowline As String = units.Get("snowline")
Dim pressure As String = units.Get("pressure")
Dim wind As String = units.Get("wind")
Dim sun As Map = 4.Get("sun")
Dim in As String = sun.Get("in")
Dim mid As String = sun.Get("mid")
Dim out As String = sun.Get("out")
Dim tempmax As String = 4.Get("tempmax")
Dim local_time_offset As Int = 4.Get("local_time_offset")
Dim moon As Map = 4.Get("moon")
Dim symbol As String = moon.Get("symbol")
Dim in As String = moon.Get("in")
Dim lumi As String = moon.Get("lumi")
Dim out As String = moon.Get("out")
Dim desc As String = moon.Get("desc")
Dim month As String = 4.Get("month")
Dim local_time As String = 4.Get("local_time")
Dim hour As List = 4.Get("hour")
For Each colhour As Map In hour
 Dim rain As String = colhour.Get("rain")
 Dim temp As String = colhour.Get("temp")
 Dim symbol_value As String = colhour.Get("symbol_value")
 Dim snowline As String = colhour.Get("snowline")
 Dim symbol_description As String = colhour.Get("symbol_description")
 Dim symbol_description2 As String = colhour.Get("symbol_description2")
 Dim pressure As String = colhour.Get("pressure")
 Dim clouds As String = colhour.Get("clouds")
 Dim uv_index As String = colhour.Get("uv_index")
 Dim symbol_value2 As String = colhour.Get("symbol_value2")
 Dim humidity As String = colhour.Get("humidity")
 Dim interval As String = colhour.Get("interval")
 Dim windchill As String = colhour.Get("windchill")
 Dim wind As Map = colhour.Get("wind")
 Dim symbol As String = wind.Get("symbol")
 Dim gusts As String = wind.Get("gusts")
 Dim dir As String = wind.Get("dir")
 Dim speed As String = wind.Get("speed")
 Dim symbolB As String = wind.Get("symbolB")
Next
Dim name As String = 4.Get("name")
Dim symbol_value2 As String = 4.Get("symbol_value2")
Dim humidity As String = 4.Get("humidity")
Dim tempmin As String = 4.Get("tempmin")
Dim wind As Map = 4.Get("wind")
Dim symbol As String = wind.Get("symbol")
Dim gusts As String = wind.Get("gusts")
Dim speed As String = wind.Get("speed")
Dim symbolB As String = wind.Get("symbolB")
Dim 5 As Map = day.Get("5")
Dim date As String = 5.Get("date")
Dim rain As String = 5.Get("rain")
Dim symbol_value As String = 5.Get("symbol_value")
Dim uv_index_max As String = 5.Get("uv_index_max")
Dim snowline As String = 5.Get("snowline")
Dim symbol_description As String = 5.Get("symbol_description")
Dim symbol_description2 As String = 5.Get("symbol_description2")
Dim pressure As String = 5.Get("pressure")
Dim units As Map = 5.Get("units")
Dim rain As String = units.Get("rain")
Dim temp As String = units.Get("temp")
Dim snowline As String = units.Get("snowline")
Dim pressure As String = units.Get("pressure")
Dim wind As String = units.Get("wind")
Dim sun As Map = 5.Get("sun")
Dim in As String = sun.Get("in")
Dim mid As String = sun.Get("mid")
Dim out As String = sun.Get("out")
Dim tempmax As String = 5.Get("tempmax")
Dim local_time_offset As Int = 5.Get("local_time_offset")
Dim moon As Map = 5.Get("moon")
Dim symbol As String = moon.Get("symbol")
Dim in As String = moon.Get("in")
Dim lumi As String = moon.Get("lumi")
Dim out As String = moon.Get("out")
Dim desc As String = moon.Get("desc")
Dim month As String = 5.Get("month")
Dim local_time As String = 5.Get("local_time")
Dim hour As List = 5.Get("hour")
For Each colhour As Map In hour
 Dim rain As String = colhour.Get("rain")
 Dim temp As String = colhour.Get("temp")
 Dim symbol_value As String = colhour.Get("symbol_value")
 Dim snowline As String = colhour.Get("snowline")
 Dim symbol_description As String = colhour.Get("symbol_description")
 Dim symbol_description2 As String = colhour.Get("symbol_description2")
 Dim pressure As String = colhour.Get("pressure")
 Dim clouds As String = colhour.Get("clouds")
 Dim uv_index As String = colhour.Get("uv_index")
 Dim symbol_value2 As String = colhour.Get("symbol_value2")
 Dim humidity As String = colhour.Get("humidity")
 Dim interval As String = colhour.Get("interval")
 Dim windchill As String = colhour.Get("windchill")
 Dim wind As Map = colhour.Get("wind")
 Dim symbol As String = wind.Get("symbol")
 Dim gusts As String = wind.Get("gusts")
 Dim dir As String = wind.Get("dir")
 Dim speed As String = wind.Get("speed")
 Dim symbolB As String = wind.Get("symbolB")
Next
Dim name As String = 5.Get("name")
Dim symbol_value2 As String = 5.Get("symbol_value2")
Dim humidity As String = 5.Get("humidity")
Dim tempmin As String = 5.Get("tempmin")
Dim wind As Map = 5.Get("wind")
Dim symbol As String = wind.Get("symbol")
Dim gusts As String = wind.Get("gusts")
Dim speed As String = wind.Get("speed")
Dim symbolB As String = wind.Get("symbolB")
Dim url As String = root.Get("url")
Dim status As Int = root.Get("status")
 
Upvote 0

Colin Evans

Active Member
Licensed User
Longtime User
Hi DonManfred, have you tried it because I have and it doesn't work, you just get loads of errors, or am I missing something

Main - 470: Current declaration does not match previous one.<br />Previous: {Type=String,Rank=1, RemoteObject=True}<br />Current: {Type=String,Rank=0, RemoteObject=True}
Main - 464: Current declaration does not match previous one.<br />Previous: {Type=String,Rank=1, RemoteObject=True}<br />Current: {Type=String,Rank=0, RemoteObject=True}
Main - 459: Unknown member: get
Main - 458: Unknown member: get
Main - 457: Unknown member: get
Main - 456: Unknown member: get
Main - 455: Unknown member: get
Main - 451: Unknown member: get
Main - 450: Unknown member: get
Main - 449: Unknown member: get
Main - 447: Unknown member: get
Main - 446: Unknown member: get
Main - 445: Unknown member: get
Main - 444: Unknown member: get
Main - 443: Unknown member: get
Main - 410: Current declaration does not match previous one.<br />Previous: {Type=String,Rank=1, RemoteObject=True}<br />Current: {Type=String,Rank=0, RemoteObject=True}
Main - 404: Current declaration does not match previous one.<br />Previous: {Type=String,Rank=1, RemoteObject=True}<br />Current: {Type=String,Rank=0, RemoteObject=True}
Main - 399: Unknown member: get
Main - 398: Unknown member: get
Main - 397: Unknown member: get
Main - 396: Unknown member: get
Main - 395: Unknown member: get
Main - 391: Unknown member: get
Main - 390: Unknown member: get
Main - 389: Unknown member: get
Main - 387: Unknown member: get
Main - 386: Unknown member: get
Main - 385: Unknown member: get
Main - 384: Unknown member: get
Main - 383: Unknown member: get
Main - 350: Current declaration does not match previous one.<br />Previous: {Type=String,Rank=1, RemoteObject=True}<br />Current: {Type=String,Rank=0, RemoteObject=True}
Main - 344: Current declaration does not match previous one.<br />Previous: {Type=String,Rank=1, RemoteObject=True}<br />Current: {Type=String,Rank=0, RemoteObject=True}
Main - 339: Unknown member: get
Main - 338: Unknown member: get
Main - 337: Unknown member: get
Main - 336: Unknown member: get
Main - 335: Unknown member: get
Main - 331: Unknown member: get
Main - 330: Unknown member: get
Main - 329: Unknown member: get
Main - 327: Unknown member: get
Main - 326: Unknown member: get
Main - 325: Unknown member: get
Main - 324: Unknown member: get
Main - 323: Unknown member: get
Main - 290: Current declaration does not match previous one.<br />Previous: {Type=String,Rank=1, RemoteObject=True}<br />Current: {Type=String,Rank=0, RemoteObject=True}
Main - 284: Current declaration does not match previous one.<br />Previous: {Type=String,Rank=1, RemoteObject=True}<br />Current: {Type=String,Rank=0, RemoteObject=True}
Main - 279: Unknown member: get
Main - 278: Unknown member: get
Main - 277: Unknown member: get
Main - 276: Unknown member: get
Main - 275: Unknown member: get
Main - 271: Unknown member: get
Main - 270: Unknown member: get
Main - 269: Unknown member: get
Main - 267: Unknown member: get
Main - 266: Unknown member: get
Main - 265: Unknown member: get
Main - 264: Unknown member: get
Main - 263: Unknown member: get
Main - 230: Current declaration does not match previous one.<br />Previous: {Type=String,Rank=1, RemoteObject=True}<br />Current: {Type=String,Rank=0, RemoteObject=True}
Main - 224: Current declaration does not match previous one.<br />Previous: {Type=String,Rank=1, RemoteObject=True}<br />Current: {Type=String,Rank=0, RemoteObject=True}
Main - 219: Unknown member: get
Main - 218: Unknown member: get
Main - 217: Unknown member: get
Main - 216: Unknown member: get
Main - 215: Unknown member: get
Main - 211: Unknown member: get
Main - 210: Unknown member: get
Main - 209: Unknown member: get
Main - 207: Unknown member: get
Main - 206: Unknown member: get
Main - 205: Unknown member: get
Main - 204: Unknown member: get
Main - 203: Unknown member: get
 
Upvote 0

Colin Evans

Active Member
Licensed User
Longtime User
My code for the equivalent after creating arrays is

B4X:
        Dim parser As JSONParser
        parser.Initialize(Job.GetString)
        Dim root As Map = parser.NextObject
        Dim day As Map = root.Get("day")
        Dim i As Int
        For i = 1 To 5 
            Dim strI As String = i
            Log("StrI: " & strI)
            Dim d1 As Map = day.Get(strI)
            date(i) = d1.Get("date")
            DateTime.DateFormat = "mm/dd/yyyy"
            description(i) = d1.Get("symbol_description")
            Log(description(i))
            rain(i) = d1.Get("rain")
            symbolV(i) = d1.Get("symbol_value")
            Log("Weather Symbol: " & symbolV(i))
            Dim sun As Map = d1.Get("sun")
            sunrise(i) = sun.Get("in")
            sunset(i) = sun.Get("out")
            tempmax(i) = d1.Get("tempmax")
            Dim moon As Map = d1.Get("moon")
            moonSymbol(i) = moon.Get("symbol")
            Log("Moon Symbol: " & moonSymbol(i))
            moonrise(i) = moon.Get("in")
            moonset(i) = moon.Get("out")
            Dim hour As List = d1.Get("hour")
            Dim y As Int
            For y = 0 To 7
                Dim strY As String = y
                Dim colhour0 As Map = hour.Get(strY)
                rainhr(i,y)  = colhour0.Get("rain")
                temphr(i,y) = colhour0.Get("temp")
                symbolVhr(i,y) = colhour0.Get("symbol_value")
                SymbolDeschr(i,y) = colhour0.Get("symbol_description")
                pressurehr(i,y) = colhour0.Get("pressure")
                windchillhr(i,y) = colhour0.Get("windchill")
                Dim wind As Map = colhour0.Get("wind")
                windsymbolhr(i,y) = wind.Get("symbol")
                gustshr(i,y) = wind.Get("gusts")
                WDirhr(i,y) = wind.Get("dir")
                WSpeedhr(i,y) = wind.Get("speed")
            Next
            DOW(i) = d1.Get("name")
            Log(DOW(i))
        Next

But as I said it fails on the 5 for the days and 7 for the hours both out of bounds, change the for next to 4 and 6 and tit works but then obviously I'm missing the last day's data
 
Upvote 0

Colin Evans

Active Member
Licensed User
Longtime User
That's what I thought I had done by changing the numeric 1 to 5 to string 1 to 5 and as I mentioned it works for the first 4 but not the fifth which is twisting my head as to why similarly the for next loop for the hours 0 to 7 works up to 6 and then fails

Are you saying I should forget the for next loops and edit the JSON generated code, which I have tried, sorry I must be missing something basic as I can't understand why it doesn't work

The date format needs to be:
B4X:
DateTime.DateFormat = "MM/dd/yyyy"
I did not look at anything else, unfamiliar with your project, as that is the first that grabbed me.
Thanks Mahares I did notice and have changed further on in the code where I use the date's, this one shouldn't be there as it isn't needed just yet, cheers for answering
 
Upvote 0

Colin Evans

Active Member
Licensed User
Longtime User
Started a new app with no distractions and then amend the JSON code provided by the B4X tool, finally got there but still can't understand why the for next loops done originally wouldn't work

B4X:
        parser.Initialize(Job.GetString)
        Dim root As Map = parser.NextObject
        Dim location As String = root.Get("location")
        Dim day As Map = root.Get("day")
        Dim d1 As Map = day.Get("1")
        Dim date As String = d1.Get("date")
        Log("Date: " & date)
        Dim rain As String = d1.Get("rain")
        Dim symbol_value As String = d1.Get("symbol_value")
        Dim uv_index_max As String = d1.Get("uv_index_max")
        Dim snowline As String = d1.Get("snowline")
        Dim symbol_description As String = d1.Get("symbol_description")
        Dim symbol_description2 As String = d1.Get("symbol_description2")
        Dim pressure As String = d1.Get("pressure")
        Dim units As Map = d1.Get("units")
        Dim rainu As String = units.Get("rain")
        Dim tempu As String = units.Get("temp")
        Dim snowlineu As String = units.Get("snowline")
        Dim pressureu As String = units.Get("pressure")
        Dim windh As String = units.Get("wind")
        Dim sun As Map = d1.Get("sun")
        Dim in As String = sun.Get("in")
        Dim mid As String = sun.Get("mid")
        Dim out As String = sun.Get("out")
        Dim tempmax As String = d1.Get("tempmax")
        Dim local_time_offset As Int = d1.Get("local_time_offset")
        Dim moon As Map = d1.Get("moon")
        Dim symbol As String = moon.Get("symbol")
        Dim in As String = moon.Get("in")
        Dim lumi As String = moon.Get("lumi")
        Dim out As String = moon.Get("out")
        Dim desc As String = moon.Get("desc")
        Dim month As String = d1.Get("month")
        Dim local_time As String = d1.Get("local_time")
        Dim hour As List = d1.Get("hour")
        For i = 0 To 7
            Dim iStr As String
            iStr = i
        Dim colhour As Map = hour.Get(iStr)
            Dim rain As String = colhour.Get("rain")
            Dim temp As String = colhour.Get("temp")
            Log("Hour temp: " & temp)
            Dim symbol_value As String = colhour.Get("symbol_value")
            Dim snowline As String = colhour.Get("snowline")
            Dim symbol_description As String = colhour.Get("symbol_description")
            Dim symbol_description2 As String = colhour.Get("symbol_description2")
            Dim pressure As String = colhour.Get("pressure")
            Dim clouds As String = colhour.Get("clouds")
            Dim uv_index As String = colhour.Get("uv_index")
            Dim symbol_value2 As String = colhour.Get("symbol_value2")
            Dim humidity As String = colhour.Get("humidity")
            Dim interval As String = colhour.Get("interval")
            Dim windchill As String = colhour.Get("windchill")
            Dim wind As Map = colhour.Get("wind")
            Dim symbolh As String = wind.Get("symbol")
            Dim gustsh As String = wind.Get("gusts")
            Dim dirh As String = wind.Get("dir")
            Dim speedh As String = wind.Get("speed")
            Dim symbolBh As String = wind.Get("symbolB")
        Next
        Dim name As String = d1.Get("name")
        Dim symbol_value2 As String = d1.Get("symbol_value2")
        Dim humidity As String = d1.Get("humidity")
        Dim tempmin As String = d1.Get("tempmin")
        Dim wind As Map = d1.Get("wind")
        Dim symbol As String = wind.Get("symbol")
        Dim gusts As String = wind.Get("gusts")
        Dim speed As String = wind.Get("speed")
        Dim symbolB As String = wind.Get("symbolB")
        Dim d2 As Map = day.Get("2")
        Dim date As String = d2.Get("date")
        Log("Date: " & date)
        Dim rain As String = d2.Get("rain")
        Dim symbol_value As String = d2.Get("symbol_value")
        Dim uv_index_max As String = d2.Get("uv_index_max")
        Dim snowline As String = d2.Get("snowline")
        Dim symbol_description As String = d2.Get("symbol_description")
        Dim symbol_description2 As String = d2.Get("symbol_description2")
        Dim pressure As String = d2.Get("pressure")
        Dim units As Map = d2.Get("units")
        Dim rain As String = units.Get("rain")
        Dim temp As String = units.Get("temp")
        Dim snowline As String = units.Get("snowline")
        Dim pressure As String = units.Get("pressure")
        Dim wind1 As String = units.Get("wind")
        Dim sun As Map = d2.Get("sun")
        Dim in As String = sun.Get("in")
        Dim mid As String = sun.Get("mid")
        Dim out As String = sun.Get("out")
        Dim tempmax As String = d2.Get("tempmax")
        Dim local_time_offset As Int = d2.Get("local_time_offset")
        Dim moon As Map = d2.Get("moon")
        Dim symbol As String = moon.Get("symbol")
        Dim in As String = moon.Get("in")
        Dim lumi As String = moon.Get("lumi")
        Dim out As String = moon.Get("out")
        Dim desc As String = moon.Get("desc")
        Dim month As String = d2.Get("month")
        Dim local_time As String = d2.Get("local_time")
        Dim hour As List = d2.Get("hour")
        For i = 0 To 7
            Dim iStr As String
            iStr = i
            Dim colhour As Map = hour.Get(iStr)
            Dim rain As String = colhour.Get("rain")
            Dim temp As String = colhour.Get("temp")
            Log("Hour temp: " & temp)
            Dim symbol_value As String = colhour.Get("symbol_value")
            Dim snowline As String = colhour.Get("snowline")
            Dim symbol_description As String = colhour.Get("symbol_description")
            Dim symbol_description2 As String = colhour.Get("symbol_description2")
            Dim pressure As String = colhour.Get("pressure")
            Dim clouds As String = colhour.Get("clouds")
            Dim uv_index As String = colhour.Get("uv_index")
            Dim symbol_value2 As String = colhour.Get("symbol_value2")
            Dim humidity As String = colhour.Get("humidity")
            Dim interval As String = colhour.Get("interval")
            Dim windchill As String = colhour.Get("windchill")
            Dim wind As Map = colhour.Get("wind")
            Dim symbol As String = wind.Get("symbol")
            Dim gusts As String = wind.Get("gusts")
            Dim dir As String = wind.Get("dir")
            Dim speed As String = wind.Get("speed")
            Dim symbolB As String = wind.Get("symbolB")
        Next
        Dim name As String = d2.Get("name")
        Dim symbol_value2 As String = d2.Get("symbol_value2")
        Dim humidity As String = d2.Get("humidity")
        Dim tempmin As String = d2.Get("tempmin")
        Dim wind As Map = d2.Get("wind")
        Dim symbol As String = wind.Get("symbol")
        Dim gusts As String = wind.Get("gusts")
        Dim speed As String = wind.Get("speed")
        Dim symbolB As String = wind.Get("symbolB")
        Dim d3 As Map = day.Get("3")
        Dim date As String = d3.Get("date")
        Log("Date: " & date)
        Dim rain As String = d3.Get("rain")
        Dim symbol_value As String = d3.Get("symbol_value")
        Dim uv_index_max As String = d3.Get("uv_index_max")
        Dim snowline As String = d3.Get("snowline")
        Dim symbol_description As String = d3.Get("symbol_description")
        Dim symbol_description2 As String = d3.Get("symbol_description2")
        Dim pressure As String = d3.Get("pressure")
        Dim units As Map = d3.Get("units")
        Dim rain As String = units.Get("rain")
        Dim temp As String = units.Get("temp")
        Dim snowline As String = units.Get("snowline")
        Dim pressure As String = units.Get("pressure")
        Dim wind2 As String = units.Get("wind")
        Dim sun As Map = d3.Get("sun")
        Dim in As String = sun.Get("in")
        Dim mid As String = sun.Get("mid")
        Dim out As String = sun.Get("out")
        Dim tempmax As String = d3.Get("tempmax")
        Dim local_time_offset As Int = d3.Get("local_time_offset")
        Dim moon As Map = d3.Get("moon")
        Dim symbol As String = moon.Get("symbol")
        Dim in As String = moon.Get("in")
        Dim lumi As String = moon.Get("lumi")
        Dim out As String = moon.Get("out")
        Dim desc As String = moon.Get("desc")
        Dim month As String = d3.Get("month")
        Dim local_time As String = d3.Get("local_time")
        Dim hour As List = d3.Get("hour")
        For i = 0 To 7
            Dim iStr As String
            iStr = i
            Dim colhour As Map = hour.Get(iStr)
            Dim rain As String = colhour.Get("rain")
            Dim temp As String = colhour.Get("temp")
            Log("Hour temp: " & temp)
            Dim symbol_value As String = colhour.Get("symbol_value")
            Dim snowline As String = colhour.Get("snowline")
            Dim symbol_description As String = colhour.Get("symbol_description")
            Dim symbol_description2 As String = colhour.Get("symbol_description2")
            Dim pressure As String = colhour.Get("pressure")
            Dim clouds As String = colhour.Get("clouds")
            Dim uv_index As String = colhour.Get("uv_index")
            Dim symbol_value2 As String = colhour.Get("symbol_value2")
            Dim humidity As String = colhour.Get("humidity")
            Dim interval As String = colhour.Get("interval")
            Dim windchill As String = colhour.Get("windchill")
            Dim wind As Map = colhour.Get("wind")
            Dim symbol As String = wind.Get("symbol")
            Dim gusts As String = wind.Get("gusts")
            Dim dir As String = wind.Get("dir")
            Dim speed As String = wind.Get("speed")
            Dim symbolB As String = wind.Get("symbolB")
        Next
        Dim name As String = d3.Get("name")
        Dim symbol_value2 As String = d3.Get("symbol_value2")
        Dim humidity As String = d3.Get("humidity")
        Dim tempmin As String = d3.Get("tempmin")
        Dim wind As Map = d3.Get("wind")
        Dim symbol As String = wind.Get("symbol")
        Dim gusts As String = wind.Get("gusts")
        Dim speed As String = wind.Get("speed")
        Dim symbolB As String = wind.Get("symbolB")
        Dim d4 As Map = day.Get("4")
        Dim date As String = d4.Get("date")
        Log("Date: " & date)
        Dim rain As String = d4.Get("rain")
        Dim symbol_value As String = d4.Get("symbol_value")
        Dim uv_index_max As String = d4.Get("uv_index_max")
        Dim snowline As String = d4.Get("snowline")
        Dim symbol_description As String = d4.Get("symbol_description")
        Dim symbol_description2 As String = d4.Get("symbol_description2")
        Dim pressure As String = d4.Get("pressure")
        Dim units As Map = d4.Get("units")
        Dim rain As String = units.Get("rain")
        Dim temp As String = units.Get("temp")
        Dim snowline As String = units.Get("snowline")
        Dim pressure As String = units.Get("pressure")
        Dim wind3 As String = units.Get("wind")
        Dim sun As Map = d4.Get("sun")
        Dim in As String = sun.Get("in")
        Dim mid As String = sun.Get("mid")
        Dim out As String = sun.Get("out")
        Dim tempmax As String = d4.Get("tempmax")
        Dim local_time_offset As Int = d4.Get("local_time_offset")
        Dim moon As Map = d4.Get("moon")
        Dim symbol As String = moon.Get("symbol")
        Dim in As String = moon.Get("in")
        Dim lumi As String = moon.Get("lumi")
        Dim out As String = moon.Get("out")
        Dim desc As String = moon.Get("desc")
        Dim month As String = d4.Get("month")
        Dim local_time As String = d4.Get("local_time")
        Dim hour As List = d4.Get("hour")
        For i = 0 To 7
            Dim iStr As String
            iStr = i
            Dim colhour As Map = hour.Get(iStr)
            Dim rain As String = colhour.Get("rain")
            Dim temp As String = colhour.Get("temp")
            Log("Hour temp: " & temp)
            Dim symbol_value As String = colhour.Get("symbol_value")
            Dim snowline As String = colhour.Get("snowline")
            Dim symbol_description As String = colhour.Get("symbol_description")
            Dim symbol_description2 As String = colhour.Get("symbol_description2")
            Dim pressure As String = colhour.Get("pressure")
            Dim clouds As String = colhour.Get("clouds")
            Dim uv_index As String = colhour.Get("uv_index")
            Dim symbol_value2 As String = colhour.Get("symbol_value2")
            Dim humidity As String = colhour.Get("humidity")
            Dim interval As String = colhour.Get("interval")
            Dim windchill As String = colhour.Get("windchill")
            Dim wind As Map = colhour.Get("wind")
            Dim symbol As String = wind.Get("symbol")
            Dim gusts As String = wind.Get("gusts")
            Dim dir As String = wind.Get("dir")
            Dim speed As String = wind.Get("speed")
            Dim symbolB As String = wind.Get("symbolB")
        Next
        Dim name As String = d4.Get("name")
        Dim symbol_value2 As String = d4.Get("symbol_value2")
        Dim humidity As String = d4.Get("humidity")
        Dim tempmin As String = d4.Get("tempmin")
        Dim wind As Map = d4.Get("wind")
        Dim symbol As String = wind.Get("symbol")
        Dim gusts As String = wind.Get("gusts")
        Dim speed As String = wind.Get("speed")
        Dim symbolB As String = wind.Get("symbolB")
        Dim d5 As Map = day.Get("5")
        Dim date As String = d5.Get("date")
        Log("Date: " & date)
        Dim rain As String = d5.Get("rain")
        Dim symbol_value As String = d5.Get("symbol_value")
        Dim uv_index_max As String = d5.Get("uv_index_max")
        Dim snowline As String = d5.Get("snowline")
        Dim symbol_description As String = d5.Get("symbol_description")
        Dim symbol_description2 As String = d5.Get("symbol_description2")
        Dim pressure As String = d5.Get("pressure")
        Dim units As Map = d5.Get("units")
        Dim rain As String = units.Get("rain")
        Dim temp As String = units.Get("temp")
        Dim snowline As String = units.Get("snowline")
        Dim pressure As String = units.Get("pressure")
        Dim wind4 As String = units.Get("wind")
        Dim sun As Map = d5.Get("sun")
        Dim in As String = sun.Get("in")
        Dim mid As String = sun.Get("mid")
        Dim out As String = sun.Get("out")
        Dim tempmax As String = d5.Get("tempmax")
        Dim local_time_offset As Int = d5.Get("local_time_offset")
        Dim moon As Map = d5.Get("moon")
        Dim symbol As String = moon.Get("symbol")
        Dim in As String = moon.Get("in")
        Dim lumi As String = moon.Get("lumi")
        Dim out As String = moon.Get("out")
        Dim desc As String = moon.Get("desc")
        Dim month As String = d5.Get("month")
        Dim local_time As String = d5.Get("local_time")
        Dim hour As List = d5.Get("hour")
        For i = 0 To 7
            Dim iStr As String
            iStr = i
            Dim colhour As Map = hour.Get(iStr)
            Dim rain As String = colhour.Get("rain")
            Dim temp As String = colhour.Get("temp")
            Log("Hour temp: " & temp)
            Dim symbol_value As String = colhour.Get("symbol_value")
            Dim snowline As String = colhour.Get("snowline")
            Dim symbol_description As String = colhour.Get("symbol_description")
            Dim symbol_description2 As String = colhour.Get("symbol_description2")
            Dim pressure As String = colhour.Get("pressure")
            Dim clouds As String = colhour.Get("clouds")
            Dim uv_index As String = colhour.Get("uv_index")
            Dim symbol_value2 As String = colhour.Get("symbol_value2")
            Dim humidity As String = colhour.Get("humidity")
            Dim interval As String = colhour.Get("interval")
            Dim windchill As String = colhour.Get("windchill")
            Dim wind As Map = colhour.Get("wind")
            Dim symbol As String = wind.Get("symbol")
            Dim gusts As String = wind.Get("gusts")
            Dim dir As String = wind.Get("dir")
            Dim speed As String = wind.Get("speed")
            Dim symbolB As String = wind.Get("symbolB")
        Next
        Dim name As String = d5.Get("name")
        Dim symbol_value2 As String = d5.Get("symbol_value2")
        Dim humidity As String = d5.Get("humidity")
        Dim tempmin As String = d5.Get("tempmin")
        Dim wind As Map = d5.Get("wind")
        Dim symbol As String = wind.Get("symbol")
        Dim gusts As String = wind.Get("gusts")
        Dim speed As String = wind.Get("speed")
        Dim symbolB As String = wind.Get("symbolB")
        Dim url As String = root.Get("url")
        Dim status As Int = root.Get("status")
Else
    Log("Error: "&Job.ErrorMessage)
End If
Job.Release
End Sub

Thanks for the input and pointing the way to resolving it
 
Upvote 0
Top