Add support for printing roArray
dblume

dblume commited on 2023-03-08 17:10:30
Showing 2 changed files, with 19 additions and 18 deletions.

... ...
@@ -30,6 +30,22 @@ function onUpdatePucidHash() as void
30 30
 end function
31 31
 
32 32
 
33
+sub printAA(aa)
34
+    for each key in aa.Keys()
35
+        val = aa[key]
36
+        if type(val) = "roByteArray"
37
+            m.top.updateText = "  " + key + " = a byte array"
38
+        elseif type(val) = "roArray"
39
+            for i=0 to val.Count()
40
+                m.top.updateText = "  " + key + "[" + i.toStr() + "] " + val[i]
41
+            end for
42
+        else
43
+            m.top.updateText = "  " + key + " = " + val.ToStr()
44
+        endif
45
+    end for
46
+end sub
47
+
48
+
33 49
 function executeTest() as void
34 50
     ' This task gets run one at the start, and then
35 51
     ' again every time the OK button is pressed.
... ...
@@ -37,26 +53,11 @@ function executeTest() as void
37 53
     deviceInfo = CreateObject("roDeviceInfo")
38 54
     aaConnectionInfo = deviceInfo.GetDisplayProperties()
39 55
     m.top.updateText = "roDeviceInfo.GetDisplayProperties"
40
-    for each key in aaConnectionInfo.Keys()
41
-        val = aaConnectionInfo[key]
42
-        if type(aaConnectionInfo[key]) <> "roByteArray"
43
-            m.top.updateText = "  " + key + " = " + val.ToStr()
44
-        else
45
-            m.top.updateText = "  " + key + " = a byte array"
46
-        endif
47
-    end for
56
+    printAA(aaConnectionInfo)
48 57
 
49
-    deviceInfo = CreateObject("roDeviceInfo")
50 58
     aaConnectionInfo = deviceInfo.GetConnectionInfo()
51 59
     m.top.updateText = "roDeviceInfo.GetConnectionInfo"
52
-    for each key in aaConnectionInfo.Keys()
53
-        val = aaConnectionInfo[key]
54
-        if type(aaConnectionInfo[key]) <> "roByteArray"
55
-            m.top.updateText = "  " + key + " = " + val.ToStr()
56
-        else
57
-            m.top.updateText = "  " + key + " = a byte array"
58
-        endif
59
-    end for
60
+    printAA(aaConnectionInfo)
60 61
 
61 62
     request = GetRequest()
62 63
     port = CreateObject("roMessagePort")
... ...
@@ -1,7 +1,7 @@
1 1
 title=dxb
2 2
 major_version=0
3 3
 minor_version=4
4
-build_version=5
4
+build_version=6
5 5
 ui_resolutions=fhd
6 6
 mm_icon_focus_hd=pkg:/images/mm_icon_focus_hd.png
7 7
 mm_icon_focus_sd=pkg:/images/mm_icon_focus_sd.png
8 8