I' m like, what the hell was I thinking? This is absolute rubbish!! I think my brain had hit one of those ... "no longer thinking modes..." ha ha ha
B4X:
private Sub GetMarginPadding(varOffsets As String) As Map
Dim m As Map = CreateMap("a":"", "x":"", "y":"", "t":"", "b":"", "l":"", "r":"")
If BANano.IsUndefined(varOffsets) Or BANano.IsUndefined(varOffsets) Then Return m
varOffsets = varOffsets.replace("-","|")
varOffsets = varOffsets.replace(",","|")
varOffsets = varOffsets.replace(";","|")
varOffsets = varOffsets.replace("|",",")
varOffsets = varOffsets.replace("?","")
varOffsets = varOffsets.replace(" ","")
varOffsets = varOffsets.trim
'
Dim ss As List = BANanoShared.StrParse(",", varOffsets)
Dim a As String = ""
Dim x As String = ""
Dim y As String = ""
Dim t As String = ""
Dim b As String = ""
Dim l As String = ""
Dim r As String = ""
'
Select Case ss.Size
Case 1
a = ss.Get(0)
a = BANanoShared.GetNumbers(a)
If a.IndexOf("=") = 0 Then a = "a=" & a
Case 2
a = ss.Get(0)
x = ss.Get(1)
a = BANanoShared.GetNumbers(a)
x = BANanoShared.GetNumbers(x)
'
If a.IndexOf("=") = 0 Then a = "a=" & a
If x.IndexOf("=") = 0 Then x = "x=" & x
Case 3
a = ss.Get(0)
x = ss.Get(1)
y = ss.Get(2)
a = BANanoShared.GetNumbers(a)
x = BANanoShared.GetNumbers(x)
y = BANanoShared.GetNumbers(y)
'
If a.IndexOf("=") = 0 Then a = "a=" & a
If x.IndexOf("=") = 0 Then x = "x=" & x
If y.IndexOf("=") = 0 Then y = "y=" & y
Case 4
a = ss.Get(0)
x = ss.Get(1)
y = ss.Get(2)
t = ss.Get(3)
a = BANanoShared.GetNumbers(a)
x = BANanoShared.GetNumbers(x)
y = BANanoShared.GetNumbers(y)
t = BANanoShared.GetNumbers(t)
'
If a.IndexOf("=") = 0 Then a = "a=" & a
If x.IndexOf("=") = 0 Then x = "x=" & x
If y.IndexOf("=") = 0 Then y = "y=" & y
If t.IndexOf("=") = 0 Then t = "t=" & t
Case 5
a = ss.Get(0)
x = ss.Get(1)
y = ss.Get(2)
t = ss.Get(3)
b = ss.Get(4)
'
a = BANanoShared.GetNumbers(a)
x = BANanoShared.GetNumbers(x)
y = BANanoShared.GetNumbers(y)
t = BANanoShared.GetNumbers(t)
b = BANanoShared.GetNumbers(b)
'
If a.IndexOf("=") = 0 Then a = "a=" & a
If x.IndexOf("=") = 0 Then x = "x=" & x
If y.IndexOf("=") = 0 Then y = "y=" & y
If t.IndexOf("=") = 0 Then t = "t=" & t
If b.IndexOf("=") = 0 Then b = "b=" & b
Case 6
a = ss.Get(0)
x = ss.Get(1)
y = ss.Get(2)
t = ss.Get(3)
b = ss.Get(4)
l = ss.Get(5)
'
a = BANanoShared.GetNumbers(a)
x = BANanoShared.GetNumbers(x)
y = BANanoShared.GetNumbers(y)
t = BANanoShared.GetNumbers(t)
b = BANanoShared.GetNumbers(b)
l = BANanoShared.GetNumbers(l)
'
If a.IndexOf("=") = 0 Then a = "a=" & a
If x.IndexOf("=") = 0 Then x = "x=" & x
If y.IndexOf("=") = 0 Then y = "y=" & y
If t.IndexOf("=") = 0 Then t = "t=" & t
If b.IndexOf("=") = 0 Then b = "b=" & b
If l.IndexOf("=") = 0 Then l = "l=" & l
Case 7
a = ss.Get(0)
x = ss.Get(1)
y = ss.Get(2)
t = ss.Get(3)
b = ss.Get(4)
l = ss.Get(5)
r = ss.Get(6)
a = BANanoShared.GetNumbers(a)
x = BANanoShared.GetNumbers(x)
y = BANanoShared.GetNumbers(y)
t = BANanoShared.GetNumbers(t)
b = BANanoShared.GetNumbers(b)
l = BANanoShared.GetNumbers(l)
r = BANanoShared.GetNumbers(r)
'
If a.IndexOf("=") = 0 Then a = "a=" & a
If x.IndexOf("=") = 0 Then x = "x=" & x
If y.IndexOf("=") = 0 Then y = "y=" & y
If t.IndexOf("=") = 0 Then t = "t=" & t
If b.IndexOf("=") = 0 Then b = "b=" & b
If l.IndexOf("=") = 0 Then l = "l=" & l
If r.IndexOf("=") = 0 Then r = "r=" & r
End Select
'
Dim sbdata As String = $"${a};${x};${y};${t};${b};${l};${r}"$
Dim ssx As List = BANanoShared.StrParse(";", sbdata)
For Each d As String In ssx
Dim k As String = BANanoShared.MvField(d, 1, "=")
Dim v As String = BANanoShared.MvField(d, 2, "=")
m.Put(k, v)
Next
Return m
End Sub
This was nonsense!!! Does, it work? It was until I added .GetNumbers...