Page 1 of 1

Any Zipped recent COUNTRY list available ?

Posted: Sat Dec 30, 2017 3:01 pm
by teriibi
Hi everyone,
For an "Menu option" Button I´m willing to use a 2xx country list names to not let users enter it by hand.

1)First, i´m needing a country list of names - ready to include in my stack / Dektop APP.
any existing link in LC forum to download a zipped one ?

2) In a general way, is it a good idea to implement a Country list using "Sqlite"
in my APP and will it work fine for my Desktop, Android and IOs versions next ?
(I figure it´ll work on Linux anyway)

3) Do you have any other "smarter" way :idea: to solve this need when user need to enter a country name.
Tks

Re: Any Zipped recent COUNTRY list available ?

Posted: Sat Dec 30, 2017 3:34 pm
by bogs
Just curious (I don't have a list of country names), but what format are you looking for the names in? 2 character (think internet style, jp, ca, us, etc.) or full names, or something else?

Re: Any Zipped recent COUNTRY list available ?

Posted: Sat Dec 30, 2017 7:30 pm
by dunbarx
You can get a list of countries anywhere

https://www.state.gov/misc/list/

A little tweaking after copying that particular list, like"

Code: Select all

filter countryList without "top of page" 
and then delete empty lines with the method of your choice. Whatever.

But that is a long list, far too long for any kind of respectable user interface.

You will want to rethink your method. I recommend having the user enter chars in a field, and a binary search at each keyDown sifts through that list and displays a handful of possible entries, narrowing as more and more chars are entered.

This is a fun project in and of itself. If you think that is worth doing, either try it yourself, or write back for more advice.

Craig Newman

Re: Any Zipped recent COUNTRY list available ?

Posted: Sun Dec 31, 2017 11:11 am
by richmond62
But that is a long list, far too long for any kind of respectable user interface.
Not necessarily if it is in a drop-down menu.
countries.png
COUNTRIES.livecode.zip
(2.27 KiB) Downloaded 166 times

Re: Any Zipped recent COUNTRY list available ?

Posted: Sun Dec 31, 2017 6:22 pm
by richmond62
Mind you, that list of countries is seriously disappointing because it does NOT list

Bouvet Island 8)

Re: Any Zipped recent COUNTRY list available ?

Posted: Tue Jan 09, 2018 2:36 pm
by teriibi
Just check your answers, Thanks to all,
...thinking of an Area preselection to shorten list.

@dunbarx
What is that search advise using a binary file, what are the pros over a pure Text seach ? :shock:

Re: Any Zipped recent COUNTRY list available ?

Posted: Tue Jan 09, 2018 3:43 pm
by dunbarx
Hi.

@ Richmond: I hate those selection lists you get when entering addresses in a form. You have to scroll forever, and the whole UI is awful

@ teriibi: So you have a long list. When the user enters characters, a keyDown handler filters out all entries that do not fit. Say the first character is a "C". The handler would filter out all lines where that char is not first. "Canada" is retained; "Sweden" is dropped. In that way, the list very quickly becomes quite short and manageable.

I also would not present the list at all until, say, the third char is entered, just to initially present a manageable length in the pull-down. From that point on, the list itself contracts as additional entries are made, until the user "sees" the line desired.

It is possible to expand this for any string within the list, not just the first char. So that if the user entered "AL" the handler would retain both "Albania" and "Italy".

But that sort of thing is up to you. Do you need help writing such a gadget?

Craig

Re: Any Zipped recent COUNTRY list available ?

Posted: Tue Jan 09, 2018 4:02 pm
by richmond62
@ Richmond: I hate those selection lists you get when entering addresses in a form.
So do I: but I was juist eftir answering the chiel's question 8)