... | ... | @@ -28,7 +28,7 @@ n = DefineNumber[ 3.14, Name "a number", <attributes...>]; |
|
|
|
|
|
first checks if the ONELAB parameter `"a number"` exists in the ONELAB database. If it does not, it creates it in the database with value `3.14`, and assigns this same value to the local Gmsh or GetDP variable `n`. A `/` character in a parameter name is interpreted as a path separator, and results in the creation of a sub-tree in the graphical user interface. If the same input file is re-analyzed later, or if another input file is parsed and the ONELAB parameter `"a number"` already exists in the database, its associated value is fetched and is assigned to the local variable `n` (unless it is labeled `ReadOnly`: see below for all the optional attributes that can be specified in addition to the `Name` of the parameter).
|
|
|
|
|
|
This means that `3.14` can be interpreted as a default value for the local variable `n` (and the ONELAB parameter `"a number"`): the first time `n = DefineNumber[ 3.14, Name "a number"]` is parsed, `n` will be assigned the default value `3.14`. The next time, `n` will be assigned whatever value is associated with the `"a number"` parameter in the ONELAB database.
|
|
|
This means that `3.14` can be interpreted as a default value for the local variable `n` (and the ONELAB parameter `"a number"`): the first time `n = DefineNumber[ 3.14, Name "a number"]` is parsed, `n` will be assigned the default value `3.14`. The next time, `n` will be assigned whatever value is associated with the `"a number"` parameter in the ONELAB database. The value in the database could be the original default value, a value set by the user in the graphical user interface, or a value set by another ONELAB client.
|
|
|
|
|
|
If no ONELAB server exists (e.g. if GetDP is run in stand-alone mode), the `DefineNumber` command simply assigns the default value `3.14` to the local variable `n`. An input file using `DefineNumber` to create an appealing graphical user interface using ONELAB can thus also be run as-is without ONELAB.
|
|
|
|
... | ... | |