newLISP Fan Club

Forum => newLISP in the real world => Topic started by: HPW on December 17, 2003, 11:17:16 PM

Title: import functions with alias-names?
Post by: HPW on December 17, 2003, 11:17:16 PM
In other enviroments you can mostly specify an alias name for the imported function.



Example:

(import "user32.dll" "MessageBoxA" "MSB")
(MSB 0 "This is the body" "Caption" 1)


Another point where things can get smaller!

Just a thought.



Or is it this?

(set 'MSB MessageBoxA)

Yes, it is. So make it in the import-call and I can save one command.

Of cource optional!
Title:
Post by: HPW on December 17, 2003, 11:52:43 PM
This would be quit nice to do this:

(context 'iSEDQPDF)
(import "iSEDQuickPDF.DLL" "iSEDNewDocument" "NewDoc")
(context 'MAIN)

Then I could use:

(iSEDQPDF:NewDoc)
Title:
Post by: Lutz on December 18, 2003, 08:03:24 AM
try this:



(set 'Win:Clock (import "kernel32.dll" "GetTickCount"))



(Win:Clock) => 1312656



You don't need to do (context 'Win) at first. The 'set' statement with a context creates the context automatically.



Lutz