MAKELONG - Compose a LONG value from two WORD values

Top  Previous  Next

Syntax

<longResult> := MAKELONG( <lowOrderWord>, <highOrderWord> )

Parameters

<lowOrderWord>

 

The low order WORD for the resulting LONG value.

 

<highOrderWord>

 

The high order WORD for the resulting LONG value.

Resulting Code

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

Description

MAKELONG composes a LONG value from the two WORD parameters passed in. Please note that the first parameter is the low order word and the second parameter is the high order word. MAKELONG is the counter macro to LOWORD and HIWORD.

 

The two word parameters are unsigned, the resulting long value is signed.

Classification

Core

Category

Value composition macros

Quick Info

Library: cckptcor.lib / cckptcor.dll

Header: windef.ch

See also

LOWORD, HIWORD

Example

 

#INCLUDE "CockpitCoreLibs.ch"

#INCLUDE "windef.ch"

 

FUNCTION Main

 

LOCAL longVal

 

* Put together a LONG value

longVal := MAKELONG(0x5678,0x1234)

 

* Display the LONG

? Hex(longVal,4)

 

* Display both WORDs

? Hex(LOWORD(longVal),2) + "-" + Hex(HIWORD(longVal),2)

 

RETURN NIL