3.8.2. User (internal) variables

NppExec allows you to create, modify and remove your own (user) variables using NppExec's commands "set" and "unset". See NppExec's help [3.1] for more details about the commands "set" and "unset".

Consider such user variables as "internal": these variables exist only for NppExec. You can create, modify and remove such variables in NppExec's commands and scripts any time you need: to store some value, to set some value in one script in order to use it in another script etc. These variables do not exist outside of NppExec (do not exist for child processes and so on). It means you can't use these variables inside external programs or tools. However, you can:

  1. pass the values of these variables as input parameters of external programs/tools (see [3.8.1]);
  2. use the command "env_set" to create a heritable environment variable [3.8.3] which will be accessed inside external programs/tools (see [3.8.1]).

NppExec 0.5.1 introduces so-called "local variables". They can be created, modified and removed using NppExec's commands "set local" and "unset local". A local variable lives inside NppExec's script that is being executed, and it is automatically deleted when the script ends. From NppExec 0.6, when something similar to "set local x = 10" is executed directly in NppExec's Console, this variable will live only in NppExec's Console and will not be visible in NppExec's scripts. Type "help set" in NppExec's Console for more details.

See also: Run-time parameters [4.3].