shirlun Active Member Licensed User Longtime User Oct 1, 2016 #1 With B4I 2.80, The following code return -1. B4X: ret = "1{234567".LastIndexOf2("{", 6) ret = "1{234567".LastIndexOf2("{", 7)
With B4I 2.80, The following code return -1. B4X: ret = "1{234567".LastIndexOf2("{", 6) ret = "1{234567".LastIndexOf2("{", 7)
JanPRO Well-Known Member Licensed User Longtime User Oct 1, 2016 #2 Hi, from the documentation: Similar to LastIndexOf. The search starts at the given index. Click to expand... Jan Upvote 0
Hi, from the documentation: Similar to LastIndexOf. The search starts at the given index. Click to expand... Jan
shirlun Active Member Licensed User Longtime User Oct 1, 2016 #3 Starts at the given index and advances to the beginning, but in my testing it returns -1 which is not correct. Upvote 0
Starts at the given index and advances to the beginning, but in my testing it returns -1 which is not correct.
JanPRO Well-Known Member Licensed User Longtime User Oct 1, 2016 #4 shirlun said: Starts at the given index and advances to the beginning Click to expand... No, thats wrong. ret = "1{234567".LastIndexOf2("{", 6) ---> Only the part "7" will be searched for the string "{", so the result is -1. In your case you should simply use B4X: ret = "1{234567".IndexOf("{") Jan Upvote 0
shirlun said: Starts at the given index and advances to the beginning Click to expand... No, thats wrong. ret = "1{234567".LastIndexOf2("{", 6) ---> Only the part "7" will be searched for the string "{", so the result is -1. In your case you should simply use B4X: ret = "1{234567".IndexOf("{") Jan
shirlun Active Member Licensed User Longtime User Oct 1, 2016 #5 In B4A, the result of above code is not -1. Upvote 0
JanPRO Well-Known Member Licensed User Longtime User Oct 1, 2016 #6 Yes, you are right. These methods seems to work differently in B4i/B4a. Jan Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 2, 2016 #7 It is a bug in LastIndex2. It is fixed for the next update. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 13, 2016 #9 Works properly here. Are you using a local builder? Have you updated it? Upvote 0
shirlun Active Member Licensed User Longtime User Oct 14, 2016 #10 Double checked, same bug in V3.0 Attachments lastindexof2.jpg 80.1 KB · Views: 210 Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 14, 2016 #11 Are you using the hosted builder? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 14, 2016 #13 Can you send me an email with your hosted builder id? Maybe the core library was not updated properly on one of the servers. Upvote 0
Can you send me an email with your hosted builder id? Maybe the core library was not updated properly on one of the servers.
shirlun Active Member Licensed User Longtime User Oct 14, 2016 #14 Have sent to [email protected] Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 14, 2016 #15 I'm running this code: B4X: Private Sub Application_Start (Nav As NavigationController) Log("1{234567".LastIndexOf2("{", 6)) End Sub It prints 1. Try to clean the project (Ctrl + P). Upvote 0
I'm running this code: B4X: Private Sub Application_Start (Nav As NavigationController) Log("1{234567".LastIndexOf2("{", 6)) End Sub It prints 1. Try to clean the project (Ctrl + P).
Erel B4X founder Staff member Licensed User Longtime User Oct 16, 2016 #17 Any other beta tester can test it? Upvote 0
JanPRO Well-Known Member Licensed User Longtime User Oct 16, 2016 #18 Hi, for me it works fine and prints 1 too. Jan Upvote 0
shirlun Active Member Licensed User Longtime User Oct 17, 2016 #19 I must use LastIndexOf to replace LastIndexOf2, this will slow down the app. B4X: x = use.SubString2(0, test + 1).LastIndexOf("{") 'x = use.LastIndexOf2("{", test) Upvote 0
I must use LastIndexOf to replace LastIndexOf2, this will slow down the app. B4X: x = use.SubString2(0, test + 1).LastIndexOf("{") 'x = use.LastIndexOf2("{", test)
shirlun Active Member Licensed User Longtime User Oct 26, 2016 #20 This bug still in v3.0 release, does it related to windows platform or other things ? Attachments cap.PNG 72.3 KB · Views: 198 Upvote 0