What is Val in VB? Val usage tutorials

Source: Internet
Author: User

What is Val in VB? In VB, val is a function that converts a numeric string into a numeric value. When it cannot be recognized as the first character of a number, it stops reading the string. Symbols and characters that are considered to be part of the value, such as the US circle number and comma, cannot be recognized. However, functions can recognize carry-in symbols & O (octal) and & H (hexadecimal ). Blank spaces, tabs, and line breaks are removed from parameters.

Val is a type conversion function:

VAL (string expression) converts a numeric string to a numeric value.

For example, VAL ("-3.85") returns-3.85.

VAL ("vb5.0") returns 0

VAL ("12 bC") returns 12

VAL is opposite to CSTR. CSTR replaces the value of a numeric expression with a string.

CSTR (125) = "125"

You still like the following:

Differences between Byval and byref in VB (example)

VB. net2008 Tutorial: Write a text encryption/decryption program

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.