| .WINDOWS | |
| Syntax | .WINDOWS
"function-name .WINDOWS [function-name DLL-name] (.WINDOWS "function-name arguments) |
| Explanation | .WINDOWS provides a limited interface to
the Windows API. Its first input is either the name of
the Windows API function or a list of two elements. The
first element of the list is the function name and the
second element is the name of the DLL where the function
is located. The function name is case-sensitive. Logo
performs an automatic search for an ASCII-specific
version of the function if it cannot be found. The
function MessageBox, for example, is defined as
MessageBoxA in the ASCII version. Optional function parameters may be supplied. They will be pushed on the stack in Pascal order. Numbers are pushed as 32-bit integers. Symbols are pushed as ASCII strings. Lists are converted to an ASCII string. A bytearray may be used as a buffer for return values or for structures. When you supply a bytearray, the address of its data area is pushed. The output is the 32-bit integer outcome of the Windows API function. Use FILLARRAY to fill a bytearray with a text string. For converting output in a bytearray into a Logo word, use TEXTARRAY. Please note that supplying incorrect parameters to a Windows API function may crash Windows. This command is not available in the Macintosh version of Terrapin Logo. |
| Example | The following
procedure displays a message box showing the text you
supply as input along with YES and NO buttons.
Depending on which button you select, the procedure
reports "TRUE or "FALSE. To display the message
box, the Windows API function MessageBox is used. TO
QUERY :MSG QUERY [DO YOU WANT TO QUIT?]
Result: FALSE |