Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[COLOR=#0000ff]# list all evironment variables[/color]
[COLOR=#804040][b]foreach[/b][/color] key [[COLOR=#804040][b]lsort[/b][/color] [[COLOR=#804040][b]array[/b][/color] names env]] {
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"[/color][COLOR=#008080]$key[/color][COLOR=#ff00ff] = [/color][COLOR=#008080]$env[/color][COLOR=#ff00ff]([/color][COLOR=#008080]$key[/color][COLOR=#ff00ff])"[/color]
}
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"***********************"[/color]
[COLOR=#0000ff]# on Windows there is variable COMPUTERNAME[/color]
[COLOR=#804040][b]set[/b][/color] computer_name [COLOR=#008080]$env[/color](COMPUTERNAME)
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"computername = '[/color][COLOR=#008080]$computer_name[/color][COLOR=#ff00ff]'"[/color]
[COLOR=#0000ff]# check if variable exists then print it[/color]
[COLOR=#804040][b]set[/b][/color] var_name {COMPUTERNAME}
[COLOR=#804040][b]if[/b][/color] {[[COLOR=#804040][b]info[/b][/color] exists env([COLOR=#008080]$var_name[/color])]} {
[COLOR=#804040][b]set[/b][/color] var_value [COLOR=#008080]$env[/color]([COLOR=#008080]$var_name[/color])
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"variable [/color][COLOR=#008080]$var_name[/color][COLOR=#ff00ff] found: '[/color][COLOR=#008080]$var_value[/color][COLOR=#ff00ff]'"[/color]
} [COLOR=#804040][b]else[/b][/color] {
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"variable [/color][COLOR=#008080]$var_name[/color][COLOR=#ff00ff] was not found !"[/color]
}
C:\Users\Work>tclsh envir.tcl
ALLUSERSPROFILE = C:\ProgramData
...
...
windir = %SystemRoot%
***********************
computername = 'DANKA-PC'
variable COMPUTERNAME found: 'DANKA-PC'