B4J Question java.lang.NumberFormatException: empty String - alwaysbusy (first post)    Mar 20, 2022   (1 reaction) Do not compare the strings, but the double values. Strings comparison is done differently in java e.g. with string1.CompareTo(String2) > 0. But as you do already put them in doubles anyway, use these values. If kef1>kef2 And kef2>1.41 Then Alwaysbusy B4A Tutorial [B4X] Sophisticated sorting with B4XComparatorSort - Erel    Mar 08, 2022   (20 reactions) This allows us to sort lists using all kinds of sophisticated ordering. Attached is an example of sorting "person" records. The fields are: Type Person (Name As String, Age As Int, Status As String) We want to first list the employees, sorted by their names and then sorted by their ages. Public Bug? NumberFormatException on a string date - emexes (first post)    Jan 17, 2023   (1 reaction) Use String method .CompareTo()
https://www.b4x.com/android/help/core.html#string_compareto
I too used to wonder why String comparison operators = and <> were implemented but < <= >= > were not. B4J Question Using To in Select Cases? - Heuristx (first post)    Jan 05, 2022   (2 reactions) As(TRange).Low.As(String).CompareTo(Val) <= 0 And O.As(TRange).High.As(String).CompareTo(Val) >= 0 Then
Return True
Else If O = Val Then
Return True
End If 'Match or not
End If 'O is Range
Next
Else
For Each O As Object In Ranges
B4A Question Comparing between tow Times ? - emexes (first post)    Nov 15, 2022   (1 reaction) Actually, you were close here; sadly, string comparisons are done using a function rather than the <=> operators.
136019
I think this one change would have got you over the line:
DateTime.DateFormat = "hh:mm"
Label1.Text= DateTime.Time(DateTime.Now)
label2.Text= "02:30"
'''If Label1.Text >= lab B4J Code Snippet [B4X] Format 10,000 (Ten Thousand) to Lakh - aeric    Jul 11, 2021   (5 reactions) Divide(thousand)
threedigit.Initialize7(mm)
threedigit.Remainder(thousand)
Dim id As Int = threedigit.LongValue
bd.SetScale2(MaxFractions, bd.ROUND_HALF_UP)
bi.Initialize6(bd)
sd.Initialize6(bi)
Dim dd As Double = Abs(bd.Subtract(sd).DoubleValue)
Unused = False
B4A Question Bug? Error comparing two strings - emexes (first post)    Jul 10, 2019   (1 reaction) Probably because Strings are objects, and when comparing objects, the "=" operator is comparing whether the two objects are actually the same one physical object in memory, not whether those objects have the same byte patterns. That's why the String class has a CompareTo method, that compares the a Italian confrontare + stringhe - Star-Dust (first post)    Jun 02, 2021   (2 reactions) Il confronto < o > non funzionano sulle stringhe... usa i compare (non quello siciliano) If str1.CompareTo(str2)<0 Then else If str1.CompareTo(str2)=0 Then else If str1.CompareTo(str2)>0 Then End If B4A Question CompareToIgnoreCase - Star-Dust (first post)    Nov 24, 2018   (3 reactions) 1)
Public Sub CompareTo1(S1 As String,S2 As String) As Int
Return S1.ToLowerCase.CompareTo(S2.ToLowerCase)
End Sub
2)
public Sub CompareTo2(S1 As String,S2 As String) As Int
Dim J As JavaObject = Me
Dim L As Int =j.RunMethod("CompareToIgnoreCase", Array(S1,S2))
Return l
End Sub
B4A Question Suggestion Needed for SearchView - emexes (first post)    Jan 07, 2023   (2 reactions) Length - 1 - Gap If Showable(I).CompareTo(Showable(I + Gap)) > 0 Then Dim Swapper As String = Showable(I) Showable(I) = Showable(I + Gap) Showable(I + Gap) = Swapper Dim Swapper As String Page: 1   2   3   4   5   6   7   Powered by ColBERT |