Re: I hope there's a more efficient way of doing this
- Posted by euphoric (admin) Oct 18, 2008
- 1061 views
axtens said...
Bruce, you could eliminate the second column I think...
Then loop through like this:
c = 1 while x > BlockRanges[c][1] do c+=1 end while c-=1 result = BlockRanges[c][2]
Data would look like this:
sequence BlockRanges BlockRanges = { { #0000, "Basic Latin" }, { #0080, "Latin-1 Supplement" }, { #0100, "Latin Extended-A" }, { #0180, "Latin Extended-B" }, { #0250, "IPA Extensions" }, ... { #F0000, "Supplementary Private Use Area-A" }, { #100000, "Supplementary Private Use Area-B" }}
Something like that.