AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DllCall documentation

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
JBensimon



Joined: 16 Nov 2004
Posts: 130
Location: New York

PostPosted: Tue May 17, 2005 3:17 pm    Post subject: DllCall documentation Reply with quote

Just making sure I got this right: the sample "FreeLibrary" call in the documentation, shown as
DllCall("FreeLibrary", UInt, hModule)
should have double-quotes around the "UInt" parameter, right?

Thanks for this new function. It's the start of a new era in extending the power of AHK via external resources (hopefully to be followed up with an I/O redirection capability for RunWait! Smile)

Jacques.
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Tue May 17, 2005 3:50 pm    Post subject: Re: DllCall documentation Reply with quote

JBensimon wrote:
should have double-quotes around the "UInt" parameter, right?
Thanks; I've fixed that.

In the next update, hopefully the quotes around the types won't be required: It will use the name of the variable instead of the contents if the contents don't match a valid type. For example, if the variable named "UInt" is blank, it will use the variable's name ("UInt") instead.
Back to top
View user's profile Send private message Send e-mail
Guest






PostPosted: Tue May 17, 2005 4:28 pm    Post subject: Reply with quote

or assign UInt := "UInt" instead? Wink
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Tue May 17, 2005 5:30 pm    Post subject: Reply with quote

No, because that would "reserve" those variable names, making them unusable for anything else. The other way avoids that, hopefully without giving up anything.
Back to top
View user's profile Send private message Send e-mail
JBensimon



Joined: 16 Nov 2004
Posts: 130
Location: New York

PostPosted: Tue May 17, 2005 9:58 pm    Post subject: Reply with quote

Quote:
...the quotes around the types won't be required: It will use the name of the variable instead of the contents if the contents don't match a valid type.

I can't help but wonder whether this would represent a "dangerous" precedent. Maybe it's just the purist in me speaking, but I am generally wary of "extra-linguistic" semantics that apply only to specific situations (e.g. would a variable's name be used instead of its contents in other situations where the contents are unexpected or inappropriate?)

Maybe I'm just ranting ... Smile

Jacques.
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Wed May 18, 2005 2:16 am    Post subject: Reply with quote

You have a good point and I'd probably agree were it not for the fact that I'm constantly forgetting to put the quotes around the types, which makes scripts hard to debug since the missing quotes are hard to spot. Since I'm sure this annoys others, it seemed best to change it.
Back to top
View user's profile Send private message Send e-mail
JBensimon



Joined: 16 Nov 2004
Posts: 130
Location: New York

PostPosted: Wed May 18, 2005 12:17 pm    Post subject: Reply with quote

Well, I certainly can't argue: what would be the point of creating your own language if you couldn't bend the rules to make your own life easier?! Smile

I don't suppose a user-defined function would have a similar ability to discover, when called, the "original" name of the variable corresponding to one of its formal parameters, right?

Jacques.
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Wed May 18, 2005 3:27 pm    Post subject: Reply with quote

JBensimon wrote:
I don't suppose a user-defined function would have a similar ability to discover, when called, the "original" name of the variable...
Not currently. Although this capability could be added, it seems too obscure. You could work around it by passing the name as a separate parameter.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group