OSHandle

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Class (inherits from Object)


New in 2021r3

Takes an Integer or a Ptr, converting both to Integer. For use with declares.

Notes

Use this class when you need to be able to pass both Integers and pointers to the same declare.

Consider a method in your Xojo code called Foo that accepts an OSHandle as a parameter. That method could then create a declare that accepts an Integer. When you call the declare method, you could then pass it a variable of type OSHandle which could have been assigned either an Integer or a Ptr.

Sample Code

To use this, declare a parameter as OSHandle:

MyMethod(handle As OSHandle)

You can then pass in either an Integer or a Ptr:

Var handle As OSHandle = 5
MyMethod(handle)

See Also

Declare keyword, External Methods topic