Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - ch_asc2( <cstring>, [ <nposition> ] ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CH_ASC2( <cString>, [ <nPosition> ] )


Parameters

<cString>
String to examine.

<nPosition>
Starting position in the string.


Returns

Two-byte unsigned integer starting at specified string position

Description

If position is omitted, the first byte (1) is assumed.

The integer is assumed to be stored in standard low-high format. To 
convert an unsigned to a signed integer, use the following UDF:

FUNCTION SignedInt( nUnsigned )
   RETURN IIF(nUnsigned < 215, nUnsigned, ;
              215 - nUnsigned)

For instance,
? SignedInt(CH_ASC2(cString, 4))


Example

// Display unsigned integer
// contained in bytes 4-5 of cString
? CH_ASC2(cString, 4)



See Also: CH_ASC1() CH_ASC4() CH_ASC8()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson