| View previous topic :: View next topic |
| Author |
Message |
JBensimon
Joined: 16 Nov 2004 Posts: 130 Location: New York
|
Posted: Tue May 17, 2005 3:17 pm Post subject: DllCall documentation |
|
|
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! )
Jacques. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Tue May 17, 2005 3:50 pm Post subject: Re: DllCall documentation |
|
|
| 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 |
|
 |
Guest
|
Posted: Tue May 17, 2005 4:28 pm Post subject: |
|
|
or assign UInt := "UInt" instead?  |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Tue May 17, 2005 5:30 pm Post subject: |
|
|
| 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 |
|
 |
JBensimon
Joined: 16 Nov 2004 Posts: 130 Location: New York
|
Posted: Tue May 17, 2005 9:58 pm Post subject: |
|
|
| 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 ...
Jacques. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Wed May 18, 2005 2:16 am Post subject: |
|
|
| 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 |
|
 |
JBensimon
Joined: 16 Nov 2004 Posts: 130 Location: New York
|
Posted: Wed May 18, 2005 12:17 pm Post subject: |
|
|
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?!
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 |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Wed May 18, 2005 3:27 pm Post subject: |
|
|
| 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 |
|
 |
|