wpSpell set location of Dictionary

  • How can I set the Dictionary location without using an ininfile or the registry. I set the initial directory in the wpspellcontroller but that does not find dictionary.
    Want to have all users on network see same dictionary (s).

  • Setup ini file in application Serve data directory. Set inifile path to that file
    Then ran application and choose congfigueation option. This creatd the ini file.
    WOuld have been easier if documentation explained this.
    What will happen when multiple users access this inin file?????

    • Offizieller Beitrag

    Hi,

    The INI file is an option. The version which was saved last will be used. (multiuser) I don't really think that this would be a problem.
    The controller can also save into the registry, which option is used is either passed as boolean to
    procedure SaveSetup(AsINI: Boolean);
    procedure LoadSetup(AsINI: Boolean);
    or
    retrieved from the property PersistencyMode which can have the values wpUseRegistry, wpUseINIFile, wpNoPersistency.

    So, if PersistencyMode is set to wpNoPersistency nothing will be saved automatically, you can use SaveSetup/LoadSetup. Of course note the properties RegistryPath and INIfilePath! In case they have not been modified an automatic value will be used. '{app}wpspell.ini' and 'Software\WPCubed\WPSpell'.

    While the location of the dictionaries is saved for all instances of WPSpell - the CurrentLanguage is saved in a key which is buiult using the application names. So different applications can share the dictionaries but do not share the user setting.

    The code is calculated by 'GetAppCode' in the WPSpell_Controller, here it would of course be possible to add the current user name.

    -

    It is possible to set the dictionaries without using any INI file. The following procedures can be used:

    Code
    { Adds all valid dictionaries in a certain path. Expects
          dictionaries to have *.DCT extension.  }
        procedure AddFromPath(path: string);
       { Adds one DCT file. Retuns nil if not found. }
        function AddFromFile(s: string): TWPDCT;
        { Adds/Find User dictionary }
        function UserDictAdd(path: string): TWPUserDic;
        { Removes User Dictionary }
        procedure UserDictRemove(path: string);

    The property CurrentLanguage controls which lanuage is currently checked. All dictionaries which use the language ID will be selected. LanguageIDs are defined in the file WPLanguages.INC. CurrentLanguage can either use the id or the group id. Usually the group ids are more effective: English=9, Frensh=1036, German=1031, Spanish=1034


    In general it is