Programming-Idioms

History of Idiom 205 > diff from v13 to v14

Edit summary for version 14 :
New VB implementation by user [silver-dragon]

Version 13

2019-09-30, 15:46:59

Version 14

2019-09-30, 19:07:28

Idiom #205 Get an environment variable

Read an environment variable with the name "FOO" and assign it to the string variable foo. If it does not exist or if the system does not support environment variables, assign a value of "none".

Idiom #205 Get an environment variable

Read an environment variable with the name "FOO" and assign it to the string variable foo. If it does not exist or if the system does not support environment variables, assign a value of "none".

Extra Keywords
envvar os system
Extra Keywords
envvar os system
Imports
imports System
Code
Dim _foo as String
Try
	_foo = Environment.FOO
Catch ex as Exception
	_foo = "none"
End Try
Doc URL
https://docs.microsoft.com/en-us/dotnet/api/system.environment?view=netframework-4.8