Skip to content
Snippets Groups Projects
Commit 3ec352da authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

doc

parent af536ce0
Branches
Tags
No related merge requests found
...@@ -997,8 +997,9 @@ parsing of the script file: ...@@ -997,8 +997,9 @@ parsing of the script file:
TextAttributes(@var{char-expression}<,@var{char-expression}@dots{}>) | TextAttributes(@var{char-expression}<,@var{char-expression}@dots{}>) |
Exists(@var{string}) | Exists(@var{string}~@{ @var{expression} @}) | Exists(@var{string}) | Exists(@var{string}~@{ @var{expression} @}) |
FileExists(@var{char-expression}) | FileExists(@var{char-expression}) |
DefineNumber(@var{expression}, @var{onelab-options}) GetNumber(@var{char-expression}) |
GetValue("@var{string}", @var{expression}) | GetValue("@var{string}", @var{expression}) |
DefineNumber(@var{expression}, @var{onelab-options}) |
@end example @end example
Such @w{@var{expression}s} are used in most of Gmsh's scripting Such @w{@var{expression}s} are used in most of Gmsh's scripting
...@@ -1036,7 +1037,14 @@ the first string is greater than, equal to, or less than the second ...@@ -1036,7 +1037,14 @@ the first string is greater than, equal to, or less than the second
string). @code{TextAttributes} creates attributes for text string). @code{TextAttributes} creates attributes for text
strings. @code{Exists} checks if a variable with the given name exists strings. @code{Exists} checks if a variable with the given name exists
(i.e., has been defined previously), and @code{FileExists} checks if the (i.e., has been defined previously), and @code{FileExists} checks if the
file with the given name exists. file with the given name exists. @code{GetNumber} allows to get the
value of a ONELAB variable (the argument is the name of the
variable). @code{GetValue} allows to ask the user for a value
interactively. For example, inserting @code{GetValue("Value of parameter
alpha?", 5.76)} in an input file will query the user for the value of a
certain parameter alpha, assuming the default value is 5.76. If the
option @code{General.NoPopup} is set (@pxref{General options list}), no
question is asked and the default value is automatically used.
@code{DefineNumber} allows to define a ONELAB variable in-line. The @code{DefineNumber} allows to define a ONELAB variable in-line. The
@var{expression} given as the first argument is the default value; this @var{expression} given as the first argument is the default value; this
...@@ -1044,13 +1052,6 @@ is followed by the various ONELAB options. See ...@@ -1044,13 +1052,6 @@ is followed by the various ONELAB options. See
@uref{http://onelab.info/wiki/ONELAB_Syntax_for_Gmsh_and_GetDP} for more @uref{http://onelab.info/wiki/ONELAB_Syntax_for_Gmsh_and_GetDP} for more
information. information.
The last case in the definition allows to ask the user for a value
interactively. For example, inserting @code{GetValue("Value of parameter
alpha?", 5.76)} in an input file will query the user for the value of a
certain parameter alpha, assuming the default value is 5.76. If the
option @code{General.NoPopup} is set (@pxref{General options list}), no
question is asked and the default value is automatically used.
@cindex Expressions, lists @cindex Expressions, lists
List of expressions are also widely used, and are defined as: List of expressions are also widely used, and are defined as:
...@@ -1122,7 +1123,7 @@ Character expressions are defined as: ...@@ -1122,7 +1123,7 @@ Character expressions are defined as:
@example @example
@var{char-expression}: @var{char-expression}:
"@var{string}" | "@var{string}" |
Today | OnelabAction | Today | OnelabAction | GmshExecutableName |
StrPrefix ( @var{char-expression} ) | StrPrefix ( @var{char-expression} ) |
StrRelative ( @var{char-expression} ) | StrRelative ( @var{char-expression} ) |
StrCat ( @var{char-expression} <,@dots{}> ) | StrCat ( @var{char-expression} <,@dots{}> ) |
...@@ -1132,6 +1133,7 @@ Character expressions are defined as: ...@@ -1132,6 +1133,7 @@ Character expressions are defined as:
Sprintf ( @var{char-expression} ) | Sprintf ( @var{char-expression} ) |
Sprintf ( @var{char-option} ) | Sprintf ( @var{char-option} ) |
GetEnv ( @var{char-expression} ) | GetEnv ( @var{char-expression} ) |
GetString ( @var{char-expression} ) |
GetString ( @var{char-expression} , @var{char-expression} ) | GetString ( @var{char-expression} , @var{char-expression} ) |
StrReplace ( @var{char-expression} , @var{char-expression} , @var{char-expression} ) StrReplace ( @var{char-expression} , @var{char-expression} , @var{char-expression} )
DefineString(@var{char-expression}, @var{onelab-options}) DefineString(@var{char-expression}, @var{onelab-options})
...@@ -1146,9 +1148,11 @@ function (where @var{char-expression} is a format string that can ...@@ -1146,9 +1148,11 @@ function (where @var{char-expression} is a format string that can
contain floating point formatting characters: @code{%e}, @code{%g}, contain floating point formatting characters: @code{%e}, @code{%g},
etc.) The various @w{@var{char-option}s} are listed in etc.) The various @w{@var{char-option}s} are listed in
@ref{Options}. @code{GetEnvThe} gets the value of an environment @ref{Options}. @code{GetEnvThe} gets the value of an environment
variable from the operating system. @code{GetString} allows to ask the variable from the operating system. @code{GetString} allows to get a
user for a value interactively. @code{StrReplace}'s arguments are: input ONELAB string value (with one argument, the name of the ONELAB
string, old substring, new substring.@footnote{For compatibility with GetDP variable), or ask the user for a value interactively (with two
arguments). @code{StrReplace}'s arguments are: input string, old
substring, new substring.@footnote{For compatibility with GetDP
(@uref{http://geuz.org/getdp/}), parentheses can be replaced by brackets (@uref{http://geuz.org/getdp/}), parentheses can be replaced by brackets
@code{[]} in @code{Str} and @code{Sprintf}.} @code{[]} in @code{Str} and @code{Sprintf}.}
...@@ -1657,6 +1661,12 @@ with the ONELAB database if it has not been defined before. See ...@@ -1657,6 +1661,12 @@ with the ONELAB database if it has not been defined before. See
@uref{http://onelab.info/wiki/ONELAB_Syntax_for_Gmsh_and_GetDP} for more @uref{http://onelab.info/wiki/ONELAB_Syntax_for_Gmsh_and_GetDP} for more
information. information.
@item SetNumber( @var{char-expression} , @var{expression} );
Sets the value a numeric ONELAB variable @var{char-expression}.
@item SetString( @var{char-expression} , @var{char-expression} );
Sets the value a string ONELAB variable @var{char-expression}.
@item @var{real-option} = @var{expression}; @item @var{real-option} = @var{expression};
Affects @var{expression} to a real option. Affects @var{expression} to a real option.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment