SV: SPELL SET CURRENT DICTIONARY and SPELL GET DICTIONARY LIST works differently on Windows and Mac, SOLVED.

2019-12-29 Thread wangel--- via 4D_Tech
Developing on PC, one sometime forgets to thoroughly check the differences 
between Windows and MacOS. Spell checker is for me one such element (amongst 
many). Being a partner, I had hoped for a little help from Tech Support. That 
was not to be, so I had to sit down and read the relevant sections in the 
manuals and do a bit of testing (bitter fruit for a lazy man). And I found out 
the following (which may be elementary to most developers):
As opposed to Windows, 4D on Mac uses (by default) a native spell checker (not 
Hunspell). That means you often cannot use SPELL SET CURRENT DICTIONARY with a 
set name like nb_NO (SPELL SET CURRENT DICTIONARY(“nb_NO”)). In this case the 
native name is nb (on my Mac). The answer is to use SPELL GET DICTIONARY 
LIST(langID;dicName;langDesc) and then pick the appropriate language from the 
list: $dicName:=dicName{dicName} and then use SPELL SET CURRENT 
DICTIONARY($dicName).
If you want to use the Hunspell dictionaries on Mac (instead of native 
dictionary), you simply use SET DATABASE PARAMETER(81;1) in the On Startup (for 
example). You can then use SPELL SET CURRENT DICTIONARY on Mac like on Windows.
Regards
Carl
--

>Message: 1
>Date: Sun, 15 Sep 2019 21:17:01 +0200
>From: 
>To: <4d_tech@lists.4d.com>
>Subject: SPELL SET CURRENT DICTIONARY and SPELL GET DICTIONARY LIST works 
>differently on Windows and Mac
>Message-ID: <000b01d56bfa$27409e80$75c1db80$@online.no>
>Content-Type: text/plain;  charset="us-ascii"

>4D v 16.6 I have the following dictionaries installed in the Hunspell folder 
>(.dic and .aff) on both Mac and Windows:
>da_DK, en_GB, en_US, es_ES, fr-modern, nb_NO, nn_NO og pt_BR 
>Out of those I have personally installed da_DK, nb_NO and nn_NO. The rest is 
>installed by 4D as standard dictionaries.
>Using SPELL GET DICTIONARY LIST I get the following list on Windows (as
>expected):
>da_DK, en_GB, en_US, es_ES, fr-modern, nb_NO, nn_NO, pt_BR 
>And on Windows I can use SPELL SET CURRENT DICTIONARY("nb_NO.dic") to load 
>nb_NO in text field using form event: On load. It works but the name on the 
>dictionary is "Unknown". The other dictionaries have a >proper/correct name.
>Using SPELL GET DICTIONARY LIST I get the following list on Mac:
>nb, en_GB, en, en_CA, en_AU, en_IN, en_SG, en_JP, da, de, es, fr, it, nl, pl, 
>pt_BR, pt_PT, fi, sv, tr, ru, ko.
>This does not reflect the dictionaries installed in the Hunspell folder.
>On Mac I cannot use SPELL SET CURRENT DICTIONARY("nb_NO.dic") to load nb_NO in 
>text field using form event: On load.
>For test purpose I use a Listbox with the following methods:
>Case of 
>: (Form event=On Load)
>ARRAY LONGINT(langID;0)
>ARRAY TEXT(dicName;0)
>ARRAY TEXT(langDesc;0)
>SPELL GET DICTIONARY LIST(langID;dicName;langDesc)
>: (Form event=On Clicked)
>C_TEXT($dicName)
>$dicName:=dicName{dicName}
>SPELL SET CURRENT DICTIONARY($dicName)
>End case 
>And to test the current dictionary I use a button with the method:
>$curLangCode:=SPELL Get current dictionary
>$countryName:=langDesc{Find in array(langID;$curLangCode)}
>ALERT("Current dictionary: "+$countryName)
>Looking at the dictionaries ID numbers on Windows compared to Mac: fr, en_US, 
>da_DK, nb_NO and es_ES are not the same. Only pt_BR and en_GB are the same. On 
>Mac nn_NO do not load. And on Mac fr and nb_NO >have the same dictionary ID 
>number.
>I can use the listbox to change dictionaries on both Mac and Windows and can 
>get nb_NO to work on Mac using this procedure. (On Mac I get Spanish when I 
>click ko). nn_NO do not load in the listbox on Mac.
>I cannot change to nb_NO (or nn_NO) using buttons on Mac with the following
>methods:
>SPELL SET CURRENT DICTIONARY("nb_NO.dic")
>SPELL SET CURRENT DICTIONARY("nb_NO")
>SPELL SET CURRENT DICTIONARY("nn_NO.dic")
>SPELL SET CURRENT DICTIONARY("nn_NO")
>I get english (USA)using buttons on Mac with the following methods:
>SPELL SET CURRENT DICTIONARY("en_GB.dic")
>SPELL SET CURRENT DICTIONARY("en_GB")
>The above appears to be the same in v17.2

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Object from row in selection listbox

2019-12-29 Thread Jeremy Roussak via 4D_Tech
Thanks for that, John. Your assumption is correct, and it does indeed look as 
if it will work. I’ll give it a try.

Jeremy

> On 28 Dec 2019, at 19:43, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> By "selection based listbox" I assume you mean traditional record selection 
> listbox and not an entity selection/collection listbox. I have not tested 
> this, but I think it will work without changing the highlighted records or 
> scroll position.
> 
> COPY SET("UserSet";"MySet")
> CUT NAMED SELECTION([Table];"CurrentSelection")
> USE SET("MySet")
> $entitySelection:=Create entity selection([Table])
> USE NAMED SELECTION("CurrentSelection")
> COPY SET("MySet";"UserSet")
> 
> Since it is not possible to pass an entity selection from one process to 
> another, it would be really nice if 4D provided direct commands to convert 
> sets and named selections into entity selections.
> 
> John DeSoi, Ph.D.
> 
> 
>> On Dec 28, 2019, at 7:35 AM, Jeremy Roussak via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> I have a selection-based listbox. I’d like to make an entity selection from 
>> the highlighted rows in the box. Is there an easy way? I’m new to ORDA, so 
>> I'probably missing something obvious.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**