Consultor Eletrônico



Kbase 18114: How to Call WIN32 API Function: Atan (Arctangent)
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   01/07/2009
Status: Verified

GOAL:

How to Call WIN32 API Function: Atan (Arctangent)

FACT(s) (Environment):

Windows 32 Intel
Windows NT 32 Intel/Windows 2000

FIX:

The following sample code shows how to call the Win32 trigonometric function called Atan which resides in the Microsoft Visual C++ runtime library called MSVCRT40.DLL. This function returns the arctangent of an angle in radians.

DEFINE VARIABLE decResult AS DECIMAL NO-UNDO.

PROCEDURE atan EXTERNAL "MSVCRT40.DLL" CDECL:
DEFINE INPUT PARAMETER dblValue AS DOUBLE NO-UNDO.
DEFINE RETURN PARAMETER dblResult AS DOUBLE NO-UNDO.
END PROCEDURE.

RUN atan (INPUT 0.655, OUTPUT decResult).

MESSAGE "The Arctangent of 0.655 is " decResult VIEW-AS ALERT-BOX.