varset subcommand
The varset subcommand creates a new user-defined variable.
Note: In the KDB kernel debugger, user variables are persistent
across invocations of the debugger but not across system reboots.
In the kdb command, user variables are not persistent
across invocations.
Format
varset name [value]
Parameters
| Item | Description |
|---|---|
| name | Specifies the name of a user variable. If it does not already exist, the variable is created. Otherwise, the value of the existing variable is changed. Variable names are case sensitive and can consist of letters, numbers, and the underscore (_) character. |
| value | Is a string assigned verbatim to the user variable specified by name. If omitted, the user variable is assigned an empty string. The value can contain spaces. |
After a variable is created, any occurrence of the variable name in a subcommand is replaced with the value assigned to that variable.
If any variable substitutions occur, the resulting subcommand
is printed between two less than and two greater than signs before
it is run. For example, <<dw kdb_avail 1>>.
All variable substitutions are done before any additional parsing of the subcommand, and the substitutions are done on a textual basis. This allows a single variable to expand into multiple subcommand parameters.
Other
No aliases.
Examples
The following is an example of how to use the varset subcommand:
KDB(0)> varset myvar kdb_avail
KDB(0)> dw myvar
<<dw kdb_avail>>
kdb_avail+000000: 00000001 00000000 0800004C 00001C43 ...........L...C
KDB(0)> varset myvar kdb_avail 1
KDB(0)> dw myvar
<<dw kdb_avail 1>>
kdb_avail+000000: 00000001 ....
KDB(0)>