CVShort
Converts an two byte string to a short variable
Syntax
`
Declare Function CVShort ( ByRef str As Const String ) As Short
`
Usage
`
result = CVShort( str )
`
Parameters
`str`
A `String` exactly two bytes in length with a binary copy of a short variable stored in it.
Return Value
Returns a `Short` variable to copy the binary copy of a short to.
Description
Does a binary copy from a 2-byte-string to a `Short` variable. The result will have a sense only if the string contained a correctly formatted `Short`, as the one generated by `MKShort`
This function is useful to read numeric values from buffers without using a `Type` definition.
Example
`
Dim a As Short, b As String
a=4534
b=MKShort(a)
Print a, CVShort(b)
Sleep
`
Dialect Differences

- Not available in the -lang qb dialect unless referenced with the alias `__Cvshort`.

Differences from QB

- New to FreeBASIC

Differences from QB

- In QBasic this function is called CVI

See also

- `MKShort`