Skip to content

Commit 796b56d

Browse files
CopilotBillWagner
andcommitted
Move CType from Functions to Operators section and update all references
Co-authored-by: BillWagner <[email protected]>
1 parent 79f2385 commit 796b56d

33 files changed

+51
-47
lines changed

.openpublishing.redirection.visual-basic.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,11 @@
12861286
{
12871287
"source_path_from_root": "/docs/visual-basic/sample-applications.md",
12881288
"redirect_url": "/samples/browse/?languages=vb"
1289+
},
1290+
{
1291+
"source_path_from_root": "/docs/visual-basic/language-reference/functions/ctype-function.md",
1292+
"redirect_url": "/dotnet/visual-basic/language-reference/operators/ctype-operator",
1293+
"redirect_document_id": true
12891294
}
12901295
]
12911296
}

docs/framework/data/adonet/sql/linq/basic-data-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Because LINQ to SQL queries translate to Transact-SQL before they are executed o
1010

1111
## Casting
1212

13-
Implicit or explicit casts are enabled from a source CLR type to a target CLR type if there is a similar valid conversion within SQL Server. For more information about CLR casting, see [CType Function](../../../../../visual-basic/language-reference/functions/ctype-function.md) (Visual Basic) and [Type-testing and cast operators](../../../../../csharp/language-reference/operators/type-testing-and-cast.md). After conversion, casts change the behavior of operations performed on a CLR expression to match the behavior of other CLR expressions that naturally map to the destination type. Casts are also translatable in the context of inheritance mapping. Objects can be cast to more specific entity subtypes so that their subtype-specific data can be accessed.
13+
Implicit or explicit casts are enabled from a source CLR type to a target CLR type if there is a similar valid conversion within SQL Server. For more information about CLR casting, see [CType Function](../../../../../visual-basic/language-reference/operators/ctype-operator.md) (Visual Basic) and [Type-testing and cast operators](../../../../../csharp/language-reference/operators/type-testing-and-cast.md). After conversion, casts change the behavior of operations performed on a CLR expression to match the behavior of other CLR expressions that naturally map to the destination type. Casts are also translatable in the context of inheritance mapping. Objects can be cast to more specific entity subtypes so that their subtype-specific data can be accessed.
1414

1515
## Equality Operators
1616

docs/visual-basic/language-reference/data-types/boolean-data-type.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ End If
6060
- [Conversion Summary](../keywords/conversion-summary.md)
6161
- [Efficient Use of Data Types](../../programming-guide/language-features/data-types/efficient-use-of-data-types.md)
6262
- [Troubleshooting Data Types](../../programming-guide/language-features/data-types/troubleshooting-data-types.md)
63-
- [CType Operator](../functions/ctype-function.md)
63+
- [CType Operator](../operators/ctype-operator.md)

docs/visual-basic/language-reference/error-messages/latebound-overload-resolution-cannot-be-applied.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ Each of the preceding lines of code explicitly casts the `Object` variable `o1`
6565

6666
- [Procedure Overloading](../../programming-guide/language-features/procedures/procedure-overloading.md)
6767
- [Overload Resolution](../../programming-guide/language-features/procedures/overload-resolution.md)
68-
- [CType Operator](../functions/ctype-function.md)
68+
- [CType Operator](../operators/ctype-operator.md)

docs/visual-basic/language-reference/functions/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ The topics in this section contain tables of the Visual Basic run-time member fu
2424

2525
[Type Conversion Functions](type-conversion-functions.md)
2626

27-
[CType Operator](ctype-function.md)
28-
2927
## Related Sections
3028

3129
[Visual Basic Language Reference](../index.md)

docs/visual-basic/language-reference/keywords/conversion-summary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Visual Basic language keywords and run-time library members are organized by pur
2020
|Convert date to serial number.|<xref:Microsoft.VisualBasic.DateAndTime.DateSerial%2A>, <xref:Microsoft.VisualBasic.DateAndTime.DateValue%2A>|
2121
|Convert decimal number to other bases.|<xref:Microsoft.VisualBasic.Conversion.Hex%2A>, <xref:Microsoft.VisualBasic.Conversion.Oct%2A>|
2222
|Convert number to string.|<xref:Microsoft.VisualBasic.Strings.Format%2A>, <xref:Microsoft.VisualBasic.Conversion.Str%2A>|
23-
|Convert one data type to another.|[CBool](../functions/type-conversion-functions.md), [CByte](../functions/type-conversion-functions.md), [CDate](../functions/type-conversion-functions.md), [CDbl](../functions/type-conversion-functions.md), [CDec](../functions/type-conversion-functions.md), [CInt](../functions/type-conversion-functions.md), [CLng](../functions/type-conversion-functions.md), [CSng](../functions/type-conversion-functions.md), [CShort](../functions/type-conversion-functions.md), [CStr](../functions/type-conversion-functions.md), [CType](../functions/ctype-function.md), <xref:Microsoft.VisualBasic.Conversion.Fix%2A>, <xref:Microsoft.VisualBasic.Conversion.Int%2A>|
23+
|Convert one data type to another.|[CBool](../functions/type-conversion-functions.md), [CByte](../functions/type-conversion-functions.md), [CDate](../functions/type-conversion-functions.md), [CDbl](../functions/type-conversion-functions.md), [CDec](../functions/type-conversion-functions.md), [CInt](../functions/type-conversion-functions.md), [CLng](../functions/type-conversion-functions.md), [CSng](../functions/type-conversion-functions.md), [CShort](../functions/type-conversion-functions.md), [CStr](../functions/type-conversion-functions.md), [CType](../operators/ctype-operator.md), <xref:Microsoft.VisualBasic.Conversion.Fix%2A>, <xref:Microsoft.VisualBasic.Conversion.Int%2A>|
2424
|Convert date to day, month, weekday, or year.|<xref:Microsoft.VisualBasic.DateAndTime.Day%2A>, <xref:Microsoft.VisualBasic.DateAndTime.Month%2A>, <xref:Microsoft.VisualBasic.DateAndTime.Weekday%2A>, <xref:Microsoft.VisualBasic.DateAndTime.Year%2A>|
2525
|Convert time to hour, minute, or second.|<xref:Microsoft.VisualBasic.DateAndTime.Hour%2A>, <xref:Microsoft.VisualBasic.DateAndTime.Minute%2A>, <xref:Microsoft.VisualBasic.DateAndTime.Second%2A>|
2626
|Convert string to ASCII value.|<xref:Microsoft.VisualBasic.Strings.Asc%2A>, <xref:Microsoft.VisualBasic.Strings.AscW%2A>|

docs/visual-basic/language-reference/modifiers/narrowing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ Indicates that a conversion operator (`CType`) converts a class or structure to
3434
- [Widening](widening.md)
3535
- [Widening and Narrowing Conversions](../../programming-guide/language-features/data-types/widening-and-narrowing-conversions.md)
3636
- [How to: Define an Operator](../../programming-guide/language-features/procedures/how-to-define-an-operator.md)
37-
- [CType Operator](../functions/ctype-function.md)
37+
- [CType Operator](../operators/ctype-operator.md)
3838
- [Option Strict Statement](../statements/option-strict-statement.md)

docs/visual-basic/language-reference/modifiers/widening.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ Indicates that a conversion operator (`CType`) converts a class or structure to
3636
- [Narrowing](narrowing.md)
3737
- [Widening and Narrowing Conversions](../../programming-guide/language-features/data-types/widening-and-narrowing-conversions.md)
3838
- [How to: Define an Operator](../../programming-guide/language-features/procedures/how-to-define-an-operator.md)
39-
- [CType Operator](../functions/ctype-function.md)
39+
- [CType Operator](../operators/ctype-operator.md)
4040
- [Option Strict Statement](../statements/option-strict-statement.md)
4141
- [How to: Define a Conversion Operator](../../programming-guide/language-features/procedures/how-to-define-a-conversion-operator.md)

docs/visual-basic/language-reference/functions/ctype-function.md renamed to docs/visual-basic/language-reference/operators/ctype-operator.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Any expression that is legal within an `As` clause in a `Dim` statement, that is
3535
> [!TIP]
3636
> You can also use the following functions to perform a type conversion:
3737
>
38-
> - Type conversion functions such as `CByte`, `CDbl`, and `CInt` that perform a conversion to a specific data type. For more information, see [Type Conversion Functions](type-conversion-functions.md).
39-
> - [DirectCast Operator](../operators/directcast-operator.md) or [TryCast Operator](../operators/trycast-operator.md). These operators require that one type inherit from or implement the other type. They can provide somewhat better performance than `CType` when converting to and from the `Object` data type.
38+
> - Type conversion functions such as `CByte`, `CDbl`, and `CInt` that perform a conversion to a specific data type. For more information, see [Type Conversion Functions](../functions/type-conversion-functions.md).
39+
> - [DirectCast Operator](directcast-operator.md) or [TryCast Operator](trycast-operator.md). These operators require that one type inherit from or implement the other type. They can provide somewhat better performance than `CType` when converting to and from the `Object` data type.
4040
4141
`CType` is compiled inline, which means that the conversion code is part of the code that evaluates the expression. In some cases, the code runs faster because no procedures are called to perform the conversion.
4242

@@ -53,8 +53,8 @@ If the data type of `expression` or `typename` is a class or structure you've de
5353
|Keyword|Data types|Argument relationship|Run-time failure|
5454
|---|---|---|---|
5555
|`CType`|Any data types|Widening or narrowing conversion must be defined between the two data types|Throws <xref:System.InvalidCastException>|
56-
|[DirectCast Operator](../operators/directcast-operator.md)|Any data types|One type must inherit from or implement the other type|Throws <xref:System.InvalidCastException>|
57-
|[TryCast](../operators/trycast-operator.md)|Reference types only|One type must inherit from or implement the other type|Returns [Nothing](../nothing.md)|
56+
|[DirectCast Operator](directcast-operator.md)|Any data types|One type must inherit from or implement the other type|Throws <xref:System.InvalidCastException>|
57+
|[TryCast](trycast-operator.md)|Reference types only|One type must inherit from or implement the other type|Returns [Nothing](../nothing.md)|
5858

5959
## Overloading
6060

@@ -76,8 +76,8 @@ For additional examples, see [Implicit and Explicit Conversions](../../programmi
7676

7777
- <xref:System.OverflowException>
7878
- <xref:System.InvalidCastException>
79-
- [Type Conversion Functions](type-conversion-functions.md)
80-
- [Conversion Functions](conversion-functions.md)
79+
- [Type Conversion Functions](../functions/type-conversion-functions.md)
80+
- [Conversion Functions](../functions/conversion-functions.md)
8181
- [Operator Statement](../statements/operator-statement.md)
8282
- [How to: Define a Conversion Operator](../../programming-guide/language-features/procedures/how-to-define-a-conversion-operator.md)
8383
- [Type Conversion in the .NET Framework](../../../standard/base-types/type-conversion.md)

docs/visual-basic/language-reference/operators/directcast-operator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Introduces a type conversion operation based on inheritance or implementation.
1717

1818
`DirectCast` does not use the Visual Basic run-time helper routines for conversion, so it can provide somewhat better performance than `CType` when converting to and from data type `Object`.
1919

20-
You use the `DirectCast` keyword similar to the way you use the [CType Operator](../functions/ctype-function.md) and the [TryCast Operator](trycast-operator.md) keyword. You supply an expression as the first argument and a type to convert it to as the second argument. `DirectCast` requires an inheritance or implementation relationship between the data types of the two arguments. This means that one type must inherit from or implement the other.
20+
You use the `DirectCast` keyword similar to the way you use the [CType Operator](../operators/ctype-operator.md) and the [TryCast Operator](trycast-operator.md) keyword. You supply an expression as the first argument and a type to convert it to as the second argument. `DirectCast` requires an inheritance or implementation relationship between the data types of the two arguments. This means that one type must inherit from or implement the other.
2121

2222
## Errors and Failures
2323

@@ -29,7 +29,7 @@ Introduces a type conversion operation based on inheritance or implementation.
2929

3030
|Keyword|Data types|Argument relationship|Run-time failure|
3131
|---|---|---|---|
32-
|[CType Operator](../functions/ctype-function.md)|Any data types|Widening or narrowing conversion must be defined between the two data types|Throws <xref:System.InvalidCastException>|
32+
|[CType Operator](../operators/ctype-operator.md)|Any data types|Widening or narrowing conversion must be defined between the two data types|Throws <xref:System.InvalidCastException>|
3333
|`DirectCast`|Any data types|One type must inherit from or implement the other type|Throws <xref:System.InvalidCastException>|
3434
|[TryCast Operator](trycast-operator.md)|Reference types only|One type must inherit from or implement the other type|Returns [Nothing](../nothing.md)|
3535

0 commit comments

Comments
 (0)