Another OOP PreCompiler

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Post by mk-soft »

Update v0371

Bugfix Includes:
- Now check Includefile to constant "#PB_Compiler_Home" and with added "+" Strings

Please test it

GT :wink:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

Thanks for update but it doesn't work...

Try to download
http://purebasic.fr/english/viewtopic.p ... sc&start=0

Next ->

Code: Select all

IncludePath #PB_Compiler_Home + "path_to_DirectX\"
XIncludeFile "d3dx9.pbi"
Class MyClass Extends BaseClass
EndClass
[COMPILER] Line 3: Syntax error!
POiNT.OF.PRESENCE group
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

and another ..

no parameters for constructor? :cry:
POiNT.OF.PRESENCE group
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Post by mk-soft »

I now know the probleme, IncludePath is not checked.

In the works.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

mk-soft wrote:In the works.
good luck :!:
POiNT.OF.PRESENCE group
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Post by mk-soft »

Update v0.372

Bugfix: Includefile and parse "IncludePath" added
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

good support!

But another moment:

topfile.oop:

Code: Select all

...
Interface IMyClass Extends IUnknown
...
Translate( Translation.D3DXVECTOR2)
EndInterface
...
dx.pbi:

Code: Select all

...
structure D3DXVECTOR2
...
endstructure
main.pb:

Code: Select all

IncludeFile "dx.pbi"

class myclass extends baseclass
  Translation.D3DXVECTOR2
endclass
Of course...
Line XX: Structure not found: D3DXVECTOR2
(topfile.oop)

coz we can not use it before it was declared... ooops...
POiNT.OF.PRESENCE group
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

I think it's total deadlock for this concept..

Resident-files save the world? :)
POiNT.OF.PRESENCE group
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Post by mk-soft »

I´m work at time to solve this probleme
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Post by mk-soft »

There I try the scourecode do not change give it the problem the methods (interfaces) at the correct place to merge. At present the interfaces are merged into topfile. This is however with structures in the methods to be used the problem.
My solution would be " a macro; Module (Classname) " to define which the interface to the correct places placed.

That´s right?
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

need to try
POiNT.OF.PRESENCE group
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Post by mk-soft »

Update v0.38

Is not the best solution, but you can now use structures

Code: Select all

; Organization for OOP with structures

; All needed structures as first
Structure udtStruct
  value1.l
  value2.l
EndStructure

; All classes and methods
Class MyClass Extends BaseClass
  ; Attributes
  val1.s
  val2.udtStruct
  ; etc
EndClass 

Method MyClass_Function(*this.MyClass, *mystruc.udtStruct)
  With *this
  
  EndWith
EndMethod

; Create Object
*myObject.iMyClass = NewObject(MyClass)

*myObject\Function(MyData.udtStruct)

; Release Object
*myObject\Release()

P.S
We can declare procedures but not interfaces.
I hope fred implimented this
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Post by mk-soft »

Update v0.39

Now included interfaces at right position without change any included scourecode. We can now splitted any classes to differend files.

Sorry, one macro has changed. Examples
- Class MyClass Extends BaseClass -> Class(MyClass) ; keyword BaseClass not longer used
- Class SubClass Extends MyClass -> Class(SubClass, MyClass)

Chaos test code

Code: Select all

; Organization for OOP with structures

; Structures for MyClass ******************************************************
Structure udtStructMyClass
  value1.l
  value2.l
EndStructure

Class(MyClass)
  ; Attributes
  val1.s
  values.udtStructMyClass
  ; etc
EndClass

Method MyClass_Function(*this.MyClass, *mystruct.udtStructMyClass)
  With *this
    \values\value1 = *mystruct\value1
  EndWith
EndMethod

; Structures for SubClass *****************************************************
Structure udtStructSubClass
  value1.l
  value2.l
EndStructure

Class(SubClass)
  ; Attributes
  val1.s
  values.udtStructSubClass
  ; etc
EndClass

Method SubClass_Function(*this.MyClass, *mystruct.udtStructSubClass)
  With *this
    \values\value1 = *mystruct\value1
  EndWith
EndMethod

; test ************************************************************************

; Create Object
*myObject.iMyClass = NewObject(MyClass)
*myObject2.iSubClass = NewObject(SubClass)
*myObject\Function(MyData.udtStructMyClass)

; Release Object
*myObject\Release()
*myObject2\Release()
P.S. Update Linux Version v0.39 :wink:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Post by mk-soft »

Update v0.40

- Performance of Release Object
- Change internal name of baseclass

GT :wink:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Post by mk-soft »

Update v0.41

- fixed DeleteObject for x64 compilations


I can´t tested because havn´t x64 os

GT :wink:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply