All this .this .that .the other

BlitzMax Forums/BlitzMax Beginners Area/All this .this .that .the other

ImaginaryHuman(Posted 2004) [#1]
Hi folks.

Ok so I'm a bit new brushing up on some old skills trying to get acquainted with BlitzMax. I'm noticing a lot of use of `.` such as .length, .pixels, .this and that.

I understand there are types involved and you can access each field with the . and the name of the field. But also I see people accessing fields that don't seem to be defined by the user, for example using .length to get the length of an array? What I'm wondering is, does the `.` let you acess a field from a type somewhere, or are you calling one of those `method` things (new to OO here)?

It seems a lot of people are mentioning a bunch of fields to access, it'd be useful to know where to get a list of what all these hidden fields are. For example getting the pixmap width and height with img.width (where img is the pixmap handle), or img.height. I didn't know you could do that kind of thing until someone mentioned it.

Is there is a list somewhere of all these hidden types or hidden methods that are accessible in this way? Also what is the difference between accessing a field and accessing a method like player.moveleft() or something? What's the correct syntax?

Thanks


FlameDuck(Posted 2004) [#2]
What I'm wondering is, does the `.` let you acess a field from a type somewhere, or are you calling one of those `method` things (new to OO here)?
It could be both. the . works much like backslash did on the Amiga, you use it to access an objects member (which we for obvious reasons refer to as methods or fields, as we'll have none of that fiddling around with members).

So you can use it to access a Types fields, but you can also use it to invoke a Types method. It's rather versatile that way, and allows for a greater degree of black-boxing.

It seems a lot of people are mentioning a bunch of fields to access, it'd be useful to know where to get a list of what all these hidden fields are.
What you're referring to here is a list of all types' public interface, the closest you'll get there I'm affraid (unless you want to go through the source code selectively), is the 'module reference'.


Loonie(Posted 2004) [#3]
read the class definitions....the modules....the source


now you have the force....

=)