PureObject - PureBasic OOP support

Developed or developing a new product in PureBasic? Tell the world about it.
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

Comtois wrote:i would like to give a try, so i downloaded "PureObject_Win32_1.0rev65.zip"

In the archiv there is a file 'OOP.exe' , when i run it, it ask for a file .pb ?

Is it an update ? must i have a previous version ? if yes, where can i download it ?
Please read my post more carefully.
- The Plugin doesn't come with an installer anymore. Detailed installation instructions for the IDE and jaPBe can be found in the project page.

EDIT: Ah, ok you did figure out by yourself :-)
Check out OOP support for PB here!
User avatar
Comtois
Addict
Addict
Posts: 1429
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

i wanted to test this http://pb-oop.origo.ethz.ch/system/files/PBOOP_DX9.zip but it dont work with the last update r65.
Please correct my english
http://purebasic.developpez.com/
Godai
Enthusiast
Enthusiast
Posts: 171
Joined: Thu Oct 05, 2006 8:13 pm

Post by Godai »

The example at the webpage crashes during the list iteration with the latest release. And you need to change This to *This to make it compile :)
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

Comtois wrote:i wanted to test this http://pb-oop.origo.ethz.ch/system/files/PBOOP_DX9.zip but it dont work with the last update r65.
This is due the fact that Hellhound did declare methods of a masterclass as "Flex" using a more anxient revision. Methods can only be "Flexible" in a Baseclass.

I did fix the code to the specs of the latest release and replaced it: http://pb-oop.origo.ethz.ch/system/files/PBOOP_DX9.zip

Godai wrote:The example at the webpage crashes during the list iteration with the latest release. And you need to change This to *This to make it compile :D
Fixed!
(The example of the documentation as well.)
Happy continuing on testing :)

Rev67 is up : http://pb-oop.origo.ethz.ch/download
Changelog : http://pb-oop.origo.ethz.ch/wiki/changelog
Check out OOP support for PB here!
Godai
Enthusiast
Enthusiast
Posts: 171
Joined: Thu Oct 05, 2006 8:13 pm

Post by Godai »

Keep up the good work! Totally rocks so far! :)
User avatar
Comtois
Addict
Addict
Posts: 1429
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

Thank you ,examples work fine now
Please correct my english
http://purebasic.developpez.com/
superadnim
Enthusiast
Enthusiast
Posts: 480
Joined: Thu Jul 27, 2006 4:06 am

Post by superadnim »

I made a class, but... am I forced to define the object handle as a pointer?, if so, why?, and why isn't this handled by the pre-processor itself?

Thanks.

PS: How portable is the code generated?, can I still make DLLs?
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

Classes are heap allocated as NewObject does actually makes use of AllocatedMemory. So Pointers do make sense and will be the way when using PureObject.


PS: How portable is the code generated?, can I still make DLLs?
Should be COM compilant, so try and import a class out of a PureObject compile and use it in an external C++ lib.

But if you're just talking about generic Dll creation, then .... try. This project is still in beta state and by this it needs user testings and -> feedback.
... and why isn't this handled by the pre-processor itself
There are many many many (if you dont mind less importand) things which are still not handled by the preprocessor, I have many ideas on a big todo list. But all next bigger addings do depent on if its really worth the work compared to that small amount of users actually using it. For my purposes it gots all it needs right now.
Check out OOP support for PB here!
superadnim
Enthusiast
Enthusiast
Posts: 480
Joined: Thu Jul 27, 2006 4:06 am

Post by superadnim »

inc. count me as a user, please.

I don't mind the pointer declaration, I was just bitchin' out loud :)

How do you handle things internally?, stack-based system?.

One thing I would like is to grab a pb-only export (that doesn't require the pre-processor) so one could share code with other people that doesn't have/use the pre-processor, is this doable?.

Thanks for this wonderful tool.

I was working on a preprocessor myself but now that I see this I won't even continue, although I was focusing on a more C-like syntax (; delimiter as line endings, c-like array declaration and variable assignment, etc. Been using a stack for the {} to resolve into the PB keywords themselves)
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

Sorry but with all respect .... why don't you read the first (release)-post or the docs when using this a tool?
Even as I did point that out in the first page.
Part of inc.'s first post wrote:- A final beautyfied output of the converted code. Easy to read i.e. in forums, like if you dont want to force the user to use the Preprocessor to make your code work!
(The converted code can be found in the users temp directory of the Windows installation)
Means you can find a beautyfied easy-to-read conversion to PB nativ code in the same directory where PB in general does safe the temporary files before sending them to the compiler. So this will be in newer PB versions your users temp file.
How do you handle things internally?, stack-based system?.
Do look into the temporary generated code like explained above and you'll see how the approach is done.
Also as I already answered you in the projects page forum, in here above and as its mentioned in the docs: objects are simply heap allocated, so no stack based system i used.

superadnim wrote:although I was focusing on a more C-like syntax (; delimiter as line endings, c-like array declaration and variable assignment
My purpose wasn't to invent a new preprocessor language, ... it is an integration of an OOP style paradigm into the present PureBasic Language and its syntax logic.
If I want to code using ";" as line endings and prefering c-like arrays then I actually simply do use "C".
I don't mind the pointer declaration, I was just bitchin' out loud
You weren't just bitching out loud, you have been triple posting your Q's over three areas.
Thats annoying btw.
Check out OOP support for PB here!
hellhound66
Enthusiast
Enthusiast
Posts: 119
Joined: Tue Feb 21, 2006 12:37 pm

Post by hellhound66 »

Removed.
Last edited by hellhound66 on Wed Mar 19, 2008 11:23 pm, edited 1 time in total.
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

Yes I noticed your bugreport ;-)
Check out OOP support for PB here!
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

it doesn't work with dreamotion...
also it crashes on with-endwith

/me want OOPureBasic :oops:
POiNT.OF.PRESENCE group
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

SofT MANiAC wrote:it doesn't work with dreamotion...
also it crashes on with-endwith

/me want OOPureBasic :oops:
... you might want to share a part of the code which makes the process crashing. Also a part of where the 'Width/EndWith' issue occurs.

Thx
Check out OOP support for PB here!
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

inc. wrote:... you might want to share a part of the code which makes the process crashing.

Thx
ok, lets start...

Dreamotion site: http://www.dreamotion3d.com/site/downloads.php

File: 11-3D2D.pb from examples

File structure:

Code: Select all

C:\PB\
|---OOP.exe
|---PureBasic.exe
|---Examples
|   `---DM3D
|        `---11-3D2D.pb
|---Includes
|   |---DM3D
|   |   `---include
|   |        |---Animate Sprite.pbi
|   |        |---d3d9.pbi
|   |        |---d3d9caps.pbi
|   |        |---d3d9types.pbi
|   |        |---d3dx9.pbi
|   |        |---d3dx9anim.pbi
|   |        |---d3dx9core.pbi
|   |        |---d3dx9effect.pbi
|   |        |---d3dx9math.pbi
|   |        |---d3dx9mathinl.pbi
|   |        |---d3dx9mesh.pbi
|   |        |---d3dx9shader.pbi
|   |        |---d3dx9shape.pbi
|   |        |---d3dx9tex.pbi
|   |        |---d3dx9xof.pbi
|   |        |---dinput.pbi
|   |        |---dplay.pbi
|   |        |---dreamotion3d.pbi
|   |        |---dreamotionStruct.pbi
|   |        |---dsound.pbi
|   |        |---DxCommon.pbi
|   |        |---dxerr9.pbi
|   |        `---Physic.pbi
|   `etc...
|
`etc...
Problem location (11-3D2D.pb):

Code: Select all

; ------------------------------------------------------------
;   DreaMotion3D
;
;   Exemple     :   2D-3D etc...
;   Historique  :
;     18/09/06  00:00    DreaMotion3D Team
;     01/11/06  19:16    TMyke
;
; ------------------------------------------------------------

; Include files
IncludePath "..\..\includes\dm3d\Include"  :  IncludeFile "dreamotion3d.pbi"
Error:
"OOP-Parser error"
"Could create file for parser output: C:\Documents and Settings\softmaniac.SOUND\Local Settings\Temp\d3dx9.pbi"
(without PureObject all is OK)
inc. wrote:Also a part of where the 'Width/EndWith' issue occurs.Thx
later...
POiNT.OF.PRESENCE group
Post Reply