Consultor Eletrônico



Kbase 18113: How to Call WIN32 API Function: Asin (Arcsine)
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   01/07/2009
Status: Unverified

GOAL:

How to Call WIN32 API Function: Asin (Arcsine)

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 Asin which resides in the Microsoft Visual C++ runtime library called MSVCRT40.DLL.  This function returns the arcsine of an angle in radians.

DEFINE VARIABLE decResult AS DECIMAL NO-UNDO.

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

/* The input parameter to the asin call must be a number */
/* between -1 and 1.  Using any other number will cause  */
/* the function call to hang.                            */

RUN asin (INPUT 0.655, OUTPUT decResult).

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