Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 1 Jahr, 9 Monaten
Letzter Beitrag:
vor 1 Jahr, 9 Monaten
Beteiligte Autoren:
DerekT, Steven Sitas

GetCountryList()' function

Startbeitrag von DerekT am 30.09.2016 11:37

Thought I would use the new 'GetCountryList()' function to save a bit of time.
This worked OK and returned 249 rows which I added to an array.

Next I needed to move 'United Kingdom' to be the first option avaiable in the list (combo).

Seemed I had everything I needed.......
lnSeekNdx is int = Nation(nationEnglish)

lnSeekRes = ArraySeek(m_Arr_Country,asLinear,"NationID",lnSeekNdx)
IF lnSeekRes > 0 THEN

The code worked fine however the result was not what I expected as row 1 of the combo now contained information relating to 'Anguilla'.
Investigation showed that both UK and Anguilla have the 'lcNation' element set with the value of 3 - there may be others but I have not looked.

I did think that there might be issues with the USA and its territories but not with the UK.

Now investigating plan B


Hi Derek,

My plan B was to use a Country table in the database, automatically populated by GetCountryList().
As of moving "your favourite" country at the top of the list/combo, I think it is better to let the user choose this - and he may have a different "favourite" country than you and me.

So why don't you let him give a "default country" in a configuration file.
This would be automatically given during inserts and if he wants to change it then let him do it through the long combo ...

Steven Sitas

von Steven Sitas - am 30.09.2016 12:30
Hi Steven

My plan B is pretty much along the lines of which you describe.
I am now storing the 3 char country ISO and Numeric ISO (belt & braces) in the user config.

My original intention was to use the 'Nation(nationEnglish)' or 'SysNation()' to offer a default when a new user was entered.

Not the end of the world but again a PCS function that sadly does not do as advertised.
Guess I should be used to that by now.

von DerekT - am 30.09.2016 12:59
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.