can someone help me to extract the rows from the value indicated in the object.
target:
10.8+
3+
5
result:
10.8
3
5
I hope it is clear
Thanks in advance
target:
10.8+
3+
5
result:
10.8
3
5
I hope it is clear
Thanks in advance
ok, I try to explain better:B4X:Dim m As Matcher = Regex.Matcher2("([\d\.]+)",Regex.MULTILINE, s)
Dim m As Matcher = Regex.Matcher2("[\d\.]+", Regex.MULTILINE, strFormula)
Dim aSegno As String
Do While m.Find
Dim aPos As Int = strFormula.IndexOf(m.Match)
If aPos = 1 Then
aSegno = strFormula.CharAt(0)
Else
Dim aStart As Int = aPos -1
Dim aLun As Int = m.Match.Length
aSegno = strFormula.SubString2(aStart, aLun+aStart)
End If
If aSegno = T_PLUS Then
dDebitCreditSign = 1.0
else if aSegno = T_MINUS Then
dDebitCreditSign = -1.0
End If
If Not(bIsFirstDiscount) And dFromToDiscount = 100.00 Then
dFromToDiscount = dFromToDiscount - aData.mPerc1
End If
...
loop
I read it but I'm not able to find solutionif you need to evaluate an expression use this code from Erel
[B4X] Eval (expressions evaluator)
The attached class allows you to evaluate mathematical expressions with support for custom functions. It is compatible with B4A, B4J and B4i. Example: Sub AppStart (Args() As String) Dim e As B4XEval e.Initialize(Me, "Eval") Log(e.Eval("1 + Min(2, Max(-4, 1), 6)"))...www.b4x.com
Dim S As String ="10+3+7-11.5+26"
Dim Lines() As String = Regex.Split("\+|\-", S)
Dim values(6) As String
Dim t As Int
Dim i As Int
Log(S)
Log("")
For Each Line As String In Lines
t=S.IndexOf(Line)
If t>0 Then
If S.CharAt(t-1)="-" Then
values(i)="-" & Line
Else
values(i)=Line
End If
Else
values(i)=Line
End If
Log(values(i))
i=i+1
Next