PDA

View Full Version : PowerBasic: nth post from Bob about objects



ErosOlmi
10-08-2008, 12:30
Other posts came out about new PB COM development.
I will list here some and than stop posting again. If interested, please go directly to PB Programming with objects (http://www.powerbasic.com/support/pbforums/forumdisplay.php?f=32) forum.

#09) Just what is COM? (http://www.powerbasic.com/support/pbforums/showthread.php?t=38164)
#10) What is a COM component? (http://www.powerbasic.com/support/pbforums/showthread.php?t=38168)
#11) How are GUID's used with objects? (http://www.powerbasic.com/support/pbforums/showthread.php?t=38170)
#12) What is inheritance? (http://www.powerbasic.com/support/pbforums/showthread.php?t=38172)

ErosOlmi
10-08-2008, 21:05
#13) So how do you create an object? (http://www.powerbasic.com/support/pbforums/showthread.php?t=38181)

#14) How do you duplicate an object variable? (http://www.powerbasic.com/support/pbforums/showthread.php?t=38182)

Petr Schreiber
10-08-2008, 21:50
#15) How do you call a direct method? (http://www.powerbasic.com/support/pbforums/showthread.php?t=38184)

This article is interesting, it describes properties as well.
Thing which surprised me is that you can assign to propertywith input specified both as parameter and expression after "=".

I haven't seen such a form of property syntax yet. Maybe it could be used for hacks like that:


Monster.Angle(%DEGREES) = 180
Monster.Angle(%RADIANS) = 3.14


... and the property method can assign correctly according to equate used.
Well, and maybe it could be used for completely different stuff and I got it wrong :D, but it is sure very interesting so far.


Petr

Michael Hartlef
10-08-2008, 22:25
#15) How do you call a direct method? (http://www.powerbasic.com/support/pbforums/showthread.php?t=38184)

This article is interesting, it describes properties as well.
Thing which surprised me is that you can assign to propertywith input specified both as parameter and expression after "=".

I haven't seen such a form of property syntax yet. Maybe it could be used for hacks like that:


Monster.Angle(%DEGREES) = 180
Monster.Angle(%RADIANS) = 3.14



... and the property method can assign correctly according to equate used.
Well, and maybe it could be used for completely different stuff and I got it wrong :D, but it is sure very interesting so far.


Petr


I never saw it before too and sadly Bob Zale didn't explain that part. But interesting to see for sure.

Petr Schreiber
10-08-2008, 22:34
Hi Mike,

maybe in another post he will do it.
I was thinking of it ( beware! :) ) and the parameter in brackets can serve as index for accessing internal array as well.


Petr

Josť Roca
10-08-2008, 23:44
I haven't seen such a form of property syntax yet.


You don't? Is the same used by VB.

ErosOlmi
11-08-2008, 07:39
In any case I really appreciate Mr Zale posting.
From one side he is "mounting" the passion, but from the other he is making a great introduction about the "road to objects" in PowerBasic.

Petr Schreiber
11-08-2008, 08:10
You don't? Is the same used by VB.


My first and last experience with VB was version 3, at that time I didn't know what object is at all ... I moved back to PB/DOS 3.2 :)


Petr

Michael Hartlef
11-08-2008, 12:59
I haven't seen such a form of property syntax yet.


You don't? Is the same used by VB.



So what does myobject.myprop(%whatever) = means?

Charles Pegge
11-08-2008, 16:40
Monster.Angle(%DEGREES) = 180


This syntax would be better:

monster.angle 180, %degrees

Petr Schreiber
11-08-2008, 17:09
Hi Charles,

your syntax means simply using method, so also possible in PB ... once it will be out, grrr :D


Petr

Josť Roca
11-08-2008, 18:33
Both syntaxes will work. My new browser will allow to generate interface definitions using a mix of methods a properties, or methods alone.

Charles Pegge
11-08-2008, 18:56
monster.angle 180, %degrees


In the future with a few additional rules to BASIC syntax, we might be able to say:

monster angle 180 degrees

Petr Schreiber
11-08-2008, 19:56
Hehe,

that reminds me of Oxygen module macro use :)


Petr