File tree Expand file tree Collapse file tree
docs/visual-basic/language-reference/data-types Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ Holds values that can be only `True` or `False`. The keywords `True` and `False`
2020
2121## Remarks
2222
23- Use the [ Boolean Data Type (Visual Basic) ] ( boolean- data- type.md ) to contain two-state values such as true/false, yes/no, or on/off.
23+ Use the ` Boolean ` data type to contain two-state values such as true/false, yes/no, or on/off.
2424
2525 The default value of ` Boolean ` is ` False ` .
2626
@@ -42,15 +42,22 @@ Holds values that can be only `True` or `False`. The keywords `True` and `False`
4242
4343## Example
4444
45- In the following example, ` runningVB ` is a ` Boolean ` variable, which stores a simple yes/no setting.
46-
47- ``` vb
48- Dim runningVB As Boolean
49- ' Check to see if program is running on Visual Basic engine.
50- If scriptEngine = "VB" Then
51- runningVB = True
52- End If
53- ```
45+ In the following example, ` isLegacyFramework ` and ` isModernNet ` are variables of type ` Boolean ` , which stores a simple yes/no setting.
46+
47+ ``` vb
48+ Dim runtimeDescription As String =
49+ Runtime.InteropServices.RuntimeInformation.FrameworkDescription
50+
51+ Dim isLegacyFramework As Boolean
52+ Dim isModernNet As Boolean
53+
54+ ' Check if the program is running on legacy or modern .NET
55+ If runtimeDescription.Contains( ".NET Framework" ) Then
56+ isLegacyFramework = True
57+ ElseIf runtimeDescription.Contains( ".NET" ) Then
58+ isModernNet = True
59+ End If
60+ ```
5461
5562## See also
5663
You can’t perform that action at this time.
0 commit comments