| View previous topic :: View next topic |
| Author |
Message |
ahkglen Guest
|
Posted: Sun Feb 21, 2010 10:57 am Post subject: early version request, Need NUMPUT() library/function |
|
|
hello, I have a script compiled on an earlier custom version of hotkey compiler. it lacks NumPut function. I am in need of this function, but cannot upgrade to get it since i have put so much effort into the compiler.
Does anyone have this function that is built-in these days? |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Mon Feb 22, 2010 12:23 am Post subject: |
|
|
Yup, its name is InsertInteger. You can find it all around. _________________
 |
|
| Back to top |
|
 |
ahkglen Guest
|
Posted: Mon Feb 22, 2010 12:53 am Post subject: |
|
|
Thank you so very much Majkinetor.
I am wondering, if NumPut is InsertInteger, .. is NumGet -> ExtractInteger?
You see, I need NumGet also. When I put ExtractInteger in place of NumGet, I am getting a "Caller must pass a variable to this ByRef parameter"
I am using this as NumGet
| Code: |
ExtractInteger(ByRef pSource, pOffset = 0, pIsSigned = false, pSize = 4) ; See DllCall for details.
{
Loop %pSize% ; Build the integer by adding up its bytes.
result += *(&pSource + pOffset + A_Index-1) << 8*(A_Index-1)
if (!pIsSigned OR pSize > 4 OR result < 0x80000000)
return result ; Signed vs. unsigned doesn't matter in these cases.
return -(0xFFFFFFFF - result + 1)
}
|
specifically for
| Code: |
DllCall(NumGet(NumGet(1*pStream)+8),"UInt",pStream)
|
Any idea what may be up there?  |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Mon Feb 22, 2010 1:06 am Post subject: |
|
|
Separate your code into multiple lines or use something like
| Code: | | DllCall(NumGet(x := NumGet( ... ) ) |
_________________
 |
|
| Back to top |
|
 |
ahkglen Guest
|
Posted: Mon Feb 22, 2010 1:12 am Post subject: |
|
|
Thank you!  |
|
| Back to top |
|
 |
|