Code: Select all
MyFunction() {
static TargetVar, RequestedCapacity = 16
VarSetCapacity(TargetVar, RequestedCapacity, 0)
NumPut(RequestedCapacity , TargetVar, 0, "Type")
DllCall("Function", "Ptr", &TargetVar)
Flag := NumGet(TargetVar, 8, "Type")
return Flag
}
Code: Select all
MyFunction() {
RequestedCapacity = 16
NumPut(RequestedCapacity , TargetVar, 0, "Type")
VarSetCapacity(TargetVar, RequestedCapacity, 0)
DllCall("Function", "Ptr", &TargetVar)
Flag := NumGet(TargetVar, 8, "Type")
return Flag
}
Calling a function with static variables multiple times, will assign the variables again?