Skip to content

Author: Norman Palardy

Introspection

Introspection is a very handy and useful part of the Xojo language.

You can use it to examine a lot of the objects that are in memory at runtime. You can access the properties in those objects, call methods on those objects and even create new instances (with some caveats here).

But there are limits to what you can do with it. You can’t use it to create things that do not exist at runtime because they’ve been stripped out when your app was built.

Comments closed

An Introspection Gotcha

Introspection is a very handy and useful part of the Xojo language.

You can use Introspection to examine many of the objects that are in memory at runtime. You can access the properties in those objects, call methods on those objects and even create new instances- with some caveats of course.

Comments closed

Casting about in both 32 and 64 bit worlds

Consider the following code:

dim i64 as Int64 = 1234567
dim i32 as int32 = 7654321

i32 = Int32(i64) // cast
i64 = Int64(i32) // cast

i32 = Ctype(i64, Int32) // convert
i64 = Ctype(i32, Int64) // convert

It all seems reasonable enough. Not useful, but seems reasonable. Only one problem. It won’t compile. Why not? The two casts to int32 and int64 will fail. Now why is that?

Comments closed

But it said DataAvailable…

But it said DataAvailable…where is all my data?

I’ve seen this a few times and have made the mistake once or twice myself. You write some code with TCP sockets and rely on the DataAvailable event as if it means “all your data is here”.

But it’s not. So the code you wrote that parses the data into its components keels over because you only have part of what you were expecting to have. And so you ask: “Why isn’t all my data here”?

Comments closed