Uniface Introduces Dynamic Assignment Files and Expressions for Enhanced Configuration Control
Software Imaging
With a worldwide reputation for bespoke application development we are leaders within the technology field.
Customizing Uniface application configuration
To address this issue, Uniface has introduced dynamic assignment files
However, merely incorporating environment variables might not suffice for all scenarios. Sometimes, it's necessary to extract specific parts of a variable or manipulate it before utilization. For instance, if an environment variable contains the application installation path including the version number, extracting this version number could streamline configuration
Expressions, denoted by "%(expression)", allow for inline evaluation of variables and operations. Drawing inspiration from Uniface's existing syntax within procedural code, expressions enable dynamic computation within assignment files. Variables, both logicals declared
For instance, consider the following snippet for a hypothetical application "MyApp":
?
[logicals]
nr1 = 150
nr2 = 65
nr_days = %(nr2 + 2 * nr1) ; 365
message = There are %(nr_days) in a year. ; There are 365 days in a year.
home = %( $USERPROFILE ) ; C:\Users\Someone
root = %( home[\\1] ) ; C:
my_app_path = %( $MYAPP_INSTALL ) ; C:\Program Files\MyApp\3.0.4
领英推荐
my_app_version = %( my_app_path[\\4] ) ; 3.0.4
major = %( my_app_version[.1] ) ; 3
minor = %( my_app_version[.2] ) ; 0
[files]
.appext %( home )\my_app%( major )%( minor )\.appext
; .appext C:\Users\Someone\myapp30\.appext
[resources]
%( my_app_path )\usys\myapp.uar
This example demonstrates how expressions can streamline configuration by dynamically generating paths and values based on environment variables and predefined logicals.
Uniface processes assignment files by first parsing the [logicals] section, allowing logicals to be referenced throughout the file. However, within the [logicals] section, the order of declaration is crucial, with variables only accessible if declared earlier in the same section. When including external assignment files using the #file directive, logicals from these files can be utilized in expressions, provided the directive precedes the [logicals] section where they are referenced. Additionally, logicals defined in system-level files can be employed in application-level assignment files, but not vice versa.
In essence, the introduction of dynamic assignment files and expressions empowers Uniface users to craft more adaptable configurations
Nice! A great feature which a lot of people will appreciate.
Managment Consultant. Subject matter expert in AI, Low Code & No Code. Accomplished sales and technology professional with extensive experience in driving revenue growth and delivering innovative solutions.
10 个月Finally, Uniface users will really appreciate this.