MAKEWORD - Compose a WORD value from two BYTE values

Top  Previous  Next

Syntax

<wordResult> := MAKEWORD( <lowOrderByte>, <highOrderByte> )

Parameters

<lowOrderByte>

 

The low order BYTE for the resulting WORD value.

 

<highOrderByte>

 

The high order BYTE for the resulting WORD value.

Resulting Code

A call to BitCombine using the proper parameters to compose a WORD value from the two BYTE parameters.

Description

MAKEWORD composes a WORD value from the two BYTE parameters passed in. Please note that the first parameter is the low order byte and the second parameter is the high order byte. MAKEWORD is the counter macro to LOBYTE and HIBYTE.

Classification

Core

Category

Value composition macros

Quick Info

Library: cckptcor.lib / cckptcor.dll

Header: windef.ch

See also

LOBYTE, HIBYTE

Example

 

#INCLUDE "CockpitCoreLibs.ch"

#INCLUDE "windef.ch"

 

FUNCTION Main

 

LOCAL wordVal

 

* Put together a WORD value

wordVal := MAKEWORD(0x34,0x12)

 

* Display the WORD

? Hex(wordVal,2)

 

* Display both WORDs

? Hex(LOBYTE(wordVal),1) + "-" + Hex(HIBYTE(wordVal),1)

 

RETURN NIL