|
| GetCountryList()' function |
| Iniciado por guest, 30,sep. 2016 13:37 - 3 respuestas |
| |
| | | |
|
| |
| Publicado el 30,septiembre 2016 - 13: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 lnSeekRes = ArraySeek(m_Arr_Country,asLinear,"NationID",lnSeekNdx) IF lnSeekRes > 0 THEN ArrayMove(m_Arr_Country,lnSeekRes,1,amMove) END 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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 30,septiembre 2016 - 14:30 |
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 www.alpha360.biz |
| |
| |
| | | |
|
| | |
| |
| Publicado el 30,septiembre 2016 - 14:56 |
Hi,
Using the nation code is not the way to go because different nations can have the same code. There are other unique identifiers (I even think al the others are), so try to base your search on lcAlpha2Code, lcAlpha3Code, lcNumericCode or even lcCaption.
lcNation is a windev code, not an ISO code, based on language - I think -(12 for holland and belgium) -> http://doc.windev.com/en-US/… |
| |
| |
| | | |
|
| | |
| |
| Publicado el 30,septiembre 2016 - 14:59 |
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. |
| |
| |
| | | |
|
| | | | |
| | |
|