Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

Chapter 12. The Language Reference > CStr Function - Pg. 214

Example Dim targetNumber As Short If IsNumeric(stringNumber) Then targetNumber = CShort(stringNumber) End If Version Differences The CShort function is new to VB under .NET. However, it corresponds directly to the VB 6 CInt function, since both return 16-bit integers. See Also CInt Function, CLng Function, CUShort Function CSng Function Syntax Dim result As Single = CSng(expression) expression (required; Numeric or String) Any expression in the valid range of the Single data type. Description The CSng function converts expression to the Single data type. Usage at a Glance