lotus API Data TypeLotusScript Data Typechar, char * ByVal Stringchar far * ByVal StringintLong (4-byte value) longLongWORD, SWORDIntegerDWORDLongINT, UINTIntegerSHORT, USHORTIntegerLONG, ULONGLongNUMBERDoubleBOOLLong (in general, sometimes Integer) BYTE, BOOLBYTEByte in R5 , can not convert pre-R5STATUSIntegerHANDLELong (Integer On Mac and Some Unix HModuleLongnullbyval Integer (0)
In general, when you have a pointer (*) to a variable, you'll want to pass that parameter ByRef, otherwise you should pass it ByVal - the exceptions are Strings (which you should pretty much always pass ByVal) and user- Defined Data Types (Which You Have to Pass Byref). If You Want To Pass A Null Value To An Api Function, Declare The Parameter As An Integer and Pass A Zero Byval.
As an enample, these Two Commonly-used API functions:
Status lnpublic nsfdbopen (Char Far * Pathname, DBHANDLE FAR * RETHDB);
Status lnpublic nsfdbclose (DBHANDLE HDB);
Are Defined Like this in LotusScript (ON A Windows Platform):
Declare function nsfdbopen lib "nnotes.dll" (byval pathname as string, _
RETHDB As long) AS Integer
Declare function nsfdbclose lib "nnotes.dll" (Byval HDB As long) AS Integer
Note that the function's return value (STATUS, in this case) is at the beginning of the function declaration in C, and the LNPUBLIC part of the function gets thrown away (that's just the calling convention in C, and has nothing to do with your LotusScript calls. If a c function returns "void", You can Treat It Like A Sub. From NSFTool