CA>I noticed the very welcome addition of pointers. I will also mention
CA>that the PB newsletter has what is probably the best pointer explanation
CA>I've seen. Now, I noticed that they were *VERY* smart and added code
CA>pointers.
Hi, Chris!
Just got it yesterday in the mail.
I like the code pointers, too. Especially since the BCDECL format
allows for the passing of parameters by reference, so that
one can emulate polymorphism as seen in OOLs.
If you're wondering whatever happened to aLIVE!, well, I'm still working
on it -- in fact, I've put about $50,000 of development time into it so
far. Thing is, we're not sure if AhuraMazda(tm) Software is going to be
releasing it as a gamma or not. It might stay an in-house tool.
Why? Well.... Imagine object oriented PowerBASIC.... PowerBASIC with
overloading, classes, inheritance, polymorphism, and .... We're not
completely sure that it would be in our best interest to release such a
tool just yet. Not until all the implications have been thoroughly
examined.
Anyway, back to pointers. First thing I did with them is try this:
DEFINT A-Z
TYPE ModemType
Init AS DWORD 'Method
Baud AS INTEGER 'Attribute
END TYPE
DIM Modem AS ModemType
ModemType..ModemType Modem
Port = 10
Message$ = "Wow, this is neat! PowerBASIC++"
CALL DWORD Modem.Init BDECL(Modem, Port, Message$)
SUB ModemType..Init (Self AS ModemType, Port AS INTEGER, Message AS STRING)
PRINT Self.Baud, Port, Message
END SUB
SUB ModemType..ModemType (Self AS ModemType)
Self.Init = CODEPTR32(ModemType..Init)
END SUB
This will all look like Swahili unless you're familiar with programming
in C++. If you are familiar with C++, however, you will see that the
above program exactly emulates "member functions" found in OOLs.
I leave it to your fertile imagination, Chris, to figure out what else
is possible with PowerBASIC 3.2!
Sincere kudos to Zale and his team at PB Inc.!
Jamshid
--- Maximus/2 2.01wb
---------------
* Origin: Sound Stage BBS - Live Via Satellite - (604)944-6476 (1:153/7070)
|