FUNCTION Integer AAA(Integer KKK, REF String Buffer, Long Length) library 'PPP.DLL'<br><br>法一:有返回值的函数<br><br> { access } FUNCTION returndatatype name ( { { REF } datatype1 arg1, ..., { REF } datatypen argn } ) LIBRARY "libname" ALIAS FOR "extname"<br>语法二:无返回值的函数<br><br> { access } SUBROUTINE name ( { { REF } datatype1 arg1, ..., { REF } datatypen argn} ) LIBRARY "libname" ALIAS FOR "extname"<br><br>参数的传递:<br><br> 通过值传递的语法: ParameterDataType Parameter<br> 通过引用传递的语法: REF ParameterDataType Parameter<br><br>实例:<br><br> 取得用户名:<br> FUNCTION BOOLEAN GetUserNameA(REF STRING uName,REF ULONG sLength) &<br> LIBRARY "advapi32.DLL"<br> STRING UserName,sLength<br> sLength = 255<br> UserName = SPACE(255) //分配空间<br> GetUserNameA(UserName,sLength)<br><br> 动态触发键盘的键值(本例为TAB):<br> #DEFINE TABKeyCode 7<br> SUBROUTINE Keybd_Event(INT bVk,INT bScan,INT dwFlags,INT dwExtraInfo) &<br> LIBRARY "user32.dll"<br> Keybd_Event(TABKeyCode,0,0,0) //按下TAB<br> Keybd_Event(TABKeyCode,0,2,0) //放开TAB<br><br>