Difference between revisions of "MC-Basic:VAL"
m (Text replace - "Read-Only" to "Read only") |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{Languages|MC-Basic:VAL}} | ||
{{MC-Basic | {{MC-Basic | ||
|SHORT FORM= | |SHORT FORM= | ||
Line 13: | Line 14: | ||
|TYPE= | |TYPE= | ||
− | '' | + | <''return value''>: Double precision<br> |
''<string>'': String | ''<string>'': String | ||
|RANGE= | |RANGE= | ||
− | '' | + | <''return value''>: ± MaxDouble<br> |
''<string>'' : String | ''<string>'' : String | ||
Line 67: | Line 68: | ||
|SEE ALSO= | |SEE ALSO= | ||
− | * [[ | + | * [[MC-Basic:STR$|STR$]] |
− | [[Category | + | [[Category:MC-Basic:String Manipulation|VAL]] |
}} | }} |
Latest revision as of 15:44, 2 May 2017
Language: | English • 中文(简体) |
---|
VAL returns the real value represented by the characters in the input string. The input string can be a number in decimal mode, scientific mode, scientific notation, or hexadecimal mode (but not binary mode).
Syntax
VAL(<string>)
Availability
All versions
Type
<return value>: Double precision
<string>: String
Range
<return value>: ± MaxDouble
<string> : String
Scope
Configuration, Task or Terminal
Limitations
Read only
Examples
-->value = VAL("123 Example")
value = 123 (converts only the first legal numbers)
-->value = VAL("123 E124xa4m3p24le")
value = 123 (The system extracts the numbers)
-->value = VAL("1.2E-2")
value = 0.012
-->value = VAL("0xFF")
value = 255
-->?VAL("")
0
-->?VAL("One hundred")
0
-->?VAL("12e7a3")
12e7
-->?VAL("65+32")
65
-->?VAL("cos(32)")
0
-->?VAL(" 321")
321