Accessing application\window using $setting

Author: i.sharp@pcisystems.co.uk (Iain Sharp)

Is it possible to set the USYS (i.e. runtime only) values in [application] on windows?  The documentation seems to suggest it is, using 

$setting("USYS","application\window","USYSDATA")=.......... However, when I try it (from the application startup trigger), it returns -1118.  If I use 

$setting("","application\window","USYSDATA")=.......... It returns 0 and successfully sets the value in the ini file for the NEXT time uniface is started.  The documentation for setting values using "USYS" is confusing, as the only example is  Addressing Runtime Settings with $setting

$setting ("ÜSYS", "WORKDIR", "USYSDATA") = ".bda/uniface/data"

Which not only has a umlaut in the USYS, but doesn't mention the section in the setting.  I have tried, "window", "[application]window" and "application/window" as well as the example.  Iain

5 Comments

  1. Hi lain, Documentation as of U9.7.02 is reporting: 1) [application] is a section that could be dynamically changed using $setting() with USYSDATA param 2) Although it is not an error to read and write settings into the registry or an .ini file that Uniface does not know about, if you try to set a runtime setting that Uniface does not support, Proc error -1118 will be issued. This also happens if the setting is a supported one, but it comes from a different section than the above-mentioned ones. Probably #2 has currently more weight than #1... Best Regards, Gianni


    Author: gianni (gianni.sandigliano@unifacesolutions.com)
  2. Hi again lain, just made a quick sample startup shell... Are you sure "window" is a valid key=value pair available into [application] section of your .ini file? My IniFile [application] section includes: [application] logotime=3 logosynch=off ; tooltip valid values: maxwidth > 300 && maxwidth < 1024 px, duration > 5 && duration < 20 seconds tooltip=utooltip(maxwidth=350;duration=5) If I write into "Application Exec" trigger: message/info $setting("USYS","application\logotime","USYSDATA") I get a proper values: 3 With: message/info $setting("USYS", "application\·*", "USYSSETTINGS") I get: logotime=NUMERIC, icon=STRING, logo256=STRING, logo16=STRING, logo2=STRING So: logosynch and tooltip key-value pairs are NOT available at runtime... In other words: what "application\window" should get/set? Best Regards, Gianni


    Author: gianni (gianni.sandigliano@unifacesolutions.com)
  3. Hi Iain, You only can set get/set specific runtime settings with $setting("USYS"). As Gianni already has mentioned, when you query the available runtime settings for [application] (usiing $setting("USYS”, “application\·*", "USYSSETTINGS") then you get the following list of available settings: logotime, icon, logo256, logo16, and logo2. And the mentioned typo in the doc (umlaut in the USYS parameter) already has been corrected in a newer versions of the Unfiace Library (see e.g. http://unifaceinfo.com/docs/0907/Uniface_Library_HTML/ulibrary/$setting_runtime_0FD2DE4D3BD84D3099305A344DB0FA7A.html). But the the mentioned sample ('$setting ("USYS", "WORKDIR", "USYSDATA") = ".bda/uniface/data"') is still not correct and it should look like this:

    $setting ("USYS", "PATHS\WORKDIR", "USYSDATA"') = ".bda/uniface/data" And there's also an open issue with $setting("USYS):

    Hope this helps. Daniel


    Author: diseli (daniel.iseli@uniface.com)
  4. I was/am looking for a method of implementing 'themes' within our application which did not involve. 

    1. Altering the .ini file on each machine, as this would hamper the rollout of new versions requiring new default paths etc. 
    2. Having a global routine called on exec of each form which sets the $windowsproperties for the form. 

    I can (sort of) see why you can't change the Shell=ushell(....) setting from within the application shell, and to be fair, these bits can be changed with $applproperties as they are only accessed once. I was looking to change the window=uwindow(.....) setting within the application shell so that all forms/etc called within the application have the same default colour/image.....  I stress that I know I CAN do this by implementing code to set the $windowproperties in the exec trigger or init operation of every form in the application, so it will work everywhere that the programmer has remembered to do this, but I was looking for something which sets the baseline.  As we actually have a 3gl 'bootstrap' for our application (to deal with assigning USTs and patching the software), I think I'm going to have to create personalised ini files for every user who uses the machine (Uniface Anywhere/RDP/Hotdesking means that one theme is not applicable to one machine) based on a template one for global defaults every time they start the application.  I didn't think to query the available settings, as I thought that only told you what was set in the ini file...  Regards, Iain


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  5.  Thanks for your reply, Iain.

    Iain Sharp said I was/am looking for a method of implementing 'themes' within our application which did not involve. 
    1. Altering the .ini file on each machine, as this would hamper the rollout of new versions requiring new default paths etc.
    2. Having a global routine called on exec of each form which sets the $windowsproperties for the form. 
    I can (sort of) see why you can't change the Shell=ushell(....) setting from within the application shell, and to be fair, these bits can be changed with $applproperties as they are only accessed once. I was looking to change the window=uwindow(.....) setting within the application shell so that all forms/etc called within the application have the same default colour/image..... 

     This probably would be a useful feature (changing the uwindow setting at runtime). Maybe you could create a wish for this.

    Iain Sharp said I stress that I know I CAN do this by implementing code to set the $windowproperties in the exec trigger or init operation of every form in the application, so it will work everywhere that the programmer has remembered to do this, but I was looking for something which sets the baseline.  As we actually have a 3gl 'bootstrap' for our application (to deal with assigning USTs and patching the software), I think I'm going to have to create personalised ini files for every user who uses the machine (Uniface Anywhere/RDP/Hotdesking means that one theme is not applicable to one machine) based on a template one for global defaults every time they start the application. 

    I know that other customers also use something similar like the mentioned 3gl 'bootstrap' for generating "dynamic" INI and ASN files. This seems to be the most practical way at the moment to achieve this kind of functionality. Probably not perfect, but i works.

    Iain Sharp said I didn't think to query the available settings, as I thought that only told you what was set in the ini file... 

    This will return the available settings from the current INI file:

    • vSettings = $setting ("", "application\·*", "INISETTINGS")

    Or:

    • vSettings = $setting ("", "application\·*", "USYSSETTINGS")

    And this will return the available runtime settings:

    • vSettings = $setting("USYS", "application\·*", "USYSSETTINGS")

    Note the difference in the first parameter of $setting.

    Iain Sharp said Regards, Iain  

    Hope this helps. Regards, Daniel


    Author: diseli (daniel.iseli@uniface.com)