Android Question Advanced Search - help needed

tsteward

Well-Known Member
Licensed User
Longtime User
I have a local database that I want to search. At the moment I have one column named series. I can change this to two columns if need be. EG Min & Max but I don't think its that straight forward. Some have no letters and others have letter only or a mix of both.
Below is a sample.

When I enter say H2312 I want to return all records where that might be possible.
And another for line 16 below 0L213

Any suggestions on how this might be done or the best way to do it?

Series
H0001-H3000
X8001-X9000
S0001-S2000
X0001-X8000
G0001-G2377
P0001-P2390
X0001-X2248
W0001-W2409
10001-15000
J0001-J1200
0001X-1706X
T0001-T1000
1-22185
3001-4481
E5001-E7700
0K001-0N718
8001-9554
V2001-V3200
70000-75928
J00-U39
E0001-E2500
G0001-G2500
HK0001-HK2500
J0001-J2500
K0001-K2500
KE0001-KE2500
L0001-L1037
P0001-P2500
T0001-T2500
V0001-V2500
LK0001-LK2500
40000-49999
O0001-O5000
D0001-D3000
M0001-M2618
VN0-VN1999
50000-69999
S4001-S5200
S5298-S6300
G8001-G9000
B8001-B9000
B8001-B9000
K0001-K1000
10100-12283
20100-23284
K0001-K1000
N225-N814
U1-U2000
FA0-FA1863
T1-3456
T1-26789
T5-3456
T1-T1200
Y2001-Y3000
7001-9000
E2001-E3000
E4001-E5000
E5000-E5999
E6001-E7000
E8000-E8999
L8001-L10000
NSP4000-NSP4999
NSP7001-NSP9000
G000-G3631
S000A-S999K
30010-32009
C8001-C9000
Y7001-Y8200
30001-37850
40001-41518
6001-7001
A6001-A7000
D0001-D2000
D4001-D5200
1HM1-99HM99
1NF1-99NF99
HM1-HM1200
HM2501-HM3500
HM4001-HM7350
HM6001-HM7110
NF1-NF1200
NM2501-NM3500
5001-8442
M0001-M1200
3001-4000
6001-7000
AB6001-AB6891
N6001-N7000
V1-V3056
V5001-V8058
W1-W9640
1V00001-5V12295
L000-L999
B1001-B2200 New
B1001-B2200 Old
B5001-B6200
B5001-B6200
HB1-HB2988
HB3001-HB5000
T1-T2330
HV1-HV854
HV1001-HV1918
HV2001-HV2830
 

Mahares

Expert
Licensed User
Longtime User
Looks interesting, but why aren't you using the text file the OP posted an read from it rather then adding each item manually.
Also, when you are posting miles of code, it is much better if you export the project to avoid copy mistakes
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
Righto, third time's the charm, and giving it a break over the weekend didn't hurt either:
Okay you're officially a Mad Man ( I mean that in the kindest, most endearing way possible)
It obviously got under your skin and became a challenge for you.

I THANK YOU!!! for all your time and efforts.
Total respect
 
Upvote 0

emexes

Expert
Licensed User
:) here is the reasoning behind me doing things 🎶 my way 🎶 🍻

Looks interesting, but why aren't you using the text file the OP posted an read from it rather then adding each item manually.

1/ because the text file was an extract from a database (I think) and thus the OP would be replacing the text-file-reading code anyway
2/ I wanted the example to be a single code file that ran without dependencies or file-finding expeditions
3/ changes to some ranges were required, and it was easier to document those in code

Also, when you are posting miles of code, it is much better if you export the project to avoid copy mistakes

1/ ^C ^V into a new project shouldn't be introducing copy mistakes 🤔
2/ it is nice to be able to see example code directly in the forum post, without having to download and extract
3/ the example was done in B4J, whereas the OP's project is apparently B4A
 
Upvote 0

emexes

Expert
Licensed User
It obviously got under your skin and became a challenge for you.

It did, because parsing those key codes was a puzzle remarkably similar to parsing part numbers, which is something I used to do a lot of. 🍻

If you do add "wtf is this key code" to your application, and you find cases where example code 3.0 falls over or "gets it wrong", let me know.

eg, there's already a bit of unused overkill in the default "is this code in this range" sub that might yet be useful
 
Upvote 0

Shelby

Well-Known Member
Licensed User
Although I'm only an expert in the field of not understanding, perhaps line 234 should have the word "lower" replaced with the word "upper"? (This is meant to be a joke, but also true.)
 
Upvote 0
Top