Page 4 of 4

Posted: Sat Sep 27, 2008 6:21 pm
by SofT MANiAC
Welcome back! :D

Posted: Thu Oct 09, 2008 7:19 pm
by mk-soft
Thanks :wink:

many to do in my job.


Have anyone tested my precompiler under X64 compiler? It´s ok?

GT 8)

Posted: Wed Dec 24, 2008 6:15 pm
by mk-soft
Update v0.42

Now two precompiler for X86 and X64
Precompiler X64 for 32 and 64 Bit for PB version 4.30

I can´t testing X64 mode!

GT :wink:

Posted: Thu Dec 25, 2008 3:43 pm
by mk-soft
Update v0.43

NEW
- Method DestroyObject

Example

Code: Select all

; Example - avoidance of memory leak with method InitObject and DestroyObject

Class(MemClass)
  *mem1
  *mem2
EndClass

; Init memory
Method MemClass_InitObject(*this.MemClass) ; <- NewObject calling InitObject
  With *this
    Debug "InitObject: AllocateMemory."
    \mem1 = AllocateMemory(10*1024)
    \mem2 = AllocateMemory(20*1024)
  EndWith
EndMethod

Method MemClass_GetMemPointer(*this.MemClass, number.l)
  Select number
    Case 1 : ProcedureReturn *this\mem1
    Case 2 : ProcedureReturn *this\mem2
    Default : ProcedureReturn 0
  EndSelect
EndMethod

Method MemClass_DestroyObject(*this.MemClass) ; <- DeleteObject or Release calling DestroyObject
  
  Debug "DestroyObject: Free Memory."
  FreeMemory(*this\mem1)
  FreeMemory(*this\mem2)
  
EndMethod

; Test Part 3
Debug "Test Part 3"
Debug ""
Debug "Mem Test 1"
*mem.IMemClass = NewObject(MemClass)
Debug "Address of Obj : " + Str(*mem)
Debug "Address of mem1: " + Str(*mem\GetMemPointer(1))
Debug "Address of mem2: " + Str(*mem\GetMemPointer(2))
*mem\Release()
Debug ""

Debug "Mem Test 2"
*mem.IMemClass = NewObject(MemClass)
Debug "Address of Obj : " + Str(*mem)
Debug "Address of mem1: " + Str(*mem\GetMemPointer(1))
Debug "Address of mem2: " + Str(*mem\GetMemPointer(2))
DeleteObject(*mem)
Debug ""

Debug "Mem Test 3"
*mem.IMemClass = NewObject(MemClass)
Debug "Address of Obj : " + Str(*mem)
Debug "Address of mem1: " + Str(*mem\GetMemPointer(1))
Debug "Address of mem2: " + Str(*mem\GetMemPointer(2))
*mem\Release()
Debug ""
GT :wink:

Posted: Fri Dec 26, 2008 7:37 am
by rko
hi,
i see this for the first time. it nead. is there any chance that the methods be in the class? ex.:

Code: Select all

Class(MemClass)
  *mem1
  *mem2
; Init memory

Method InitObject() ; <- NewObject calling InitObject
  With *this
    Debug "InitObject: AllocateMemory."
    \mem1 = AllocateMemory(10*1024)
    \mem2 = AllocateMemory(20*1024)
  EndWith
EndMethod
EndClass
would give the added effect to be able to drop the "MemClass_" and the "*this.MemClass".javascript:emoticon(':P')
it would not be needed then

it would be neat to have class methods with the same name, but a different signature:

Code: Select all

Method xxx(somevar.s) ; <- NewObject calling

Code: Select all

Method xxx(somevar.i) ; <- NewObject calling
it would be neat to have get some syntactic sugar for getters and setter like in c# or other languages.

maybe some of it is possible - it would make thinks easier to read and to maintain. thanks for nice tool

rko

Posted: Sat Dec 27, 2008 4:54 am
by mk-soft
Update v0.43 ref 14240

-Bugfix DestroyObject

GT

P.S.

The methods within Class to programming for to a substantial larger expenditure in the case of the translation Main and all Inc. charge files. Thus even to larger sources of error. With the structure which I need I did not select the Scourecode to change and all necessities can with macros and as soon as additional Inc. charge files, which are merged clean, to cover. Thus the error tracing functions with PB as used.

Posted: Sun Jun 21, 2009 5:32 pm
by mk-soft
Update v0.44

New:
Method Class_InitObject(...) now with parameters.
When InitObject() without parameters can calling NewObject(ClassName) for compatible old projects, but using parameters calling NewClassName(para1, etc)
sorry for my english
example

Code: Select all


; Example Part 3 - avoidance of memory leak with method InitObject and DestroyObject

Class(MemClass)
  *mem1
  *mem2
EndClass

; Init memory
Method MemClass_InitObject(*this.MemClass, size.i) ; <- NewMemClass calling InitObject
  With *this
    Debug "InitObject: AllocateMemory."
    \mem1 = AllocateMemory(size*1024)
    \mem2 = AllocateMemory(size*1024)
  EndWith
EndMethod

Method MemClass_GetMemPointer(*this.MemClass, number.l)
  Select number
    Case 1 : ProcedureReturn *this\mem1
    Case 2 : ProcedureReturn *this\mem2
    Default : ProcedureReturn 0
  EndSelect
EndMethod

Method MemClass_DestroyObject(*this.MemClass) ; <- DeleteObject or Release calling DestroyObject
  
  Debug "DestroyObject: Free Memory."
  FreeMemory(*this\mem1)
  FreeMemory(*this\mem2)
  
EndMethod

; Test Part 3
Debug "Test Part 3"
Debug ""
Debug "Mem Test 1"
*mem.IMemClass = NewMemClass(10)
Debug "Address of Obj : " + Str(*mem)
Debug "Address of mem1: " + Str(*mem\GetMemPointer(1))
Debug "Address of mem2: " + Str(*mem\GetMemPointer(2))
DeleteObject(*mem)
;*mem\Release()
Debug ""

Debug "Mem Test 2"
*mem.IMemClass = NewMemClass(10)
Debug "Address of Obj : " + Str(*mem)
Debug "Address of mem1: " + Str(*mem\GetMemPointer(1))
Debug "Address of mem2: " + Str(*mem\GetMemPointer(2))
DeleteObject(*mem)
;*mem\Release()
Debug ""

Debug "Mem Test 3"
*mem.IMemClass = NewMemClass(10)
Debug "Address of Obj : " + Str(*mem)
Debug "Address of mem1: " + Str(*mem\GetMemPointer(1))
Debug "Address of mem2: " + Str(*mem\GetMemPointer(2))
DeleteObject(*mem)
;*mem\Release()
Debug ""

Debug "Mem Test 4"
*mem.IMemClass = NewMemClass(10)
Debug "Address of Obj : " + Str(*mem)
Debug "Address of mem1: " + Str(*mem\GetMemPointer(1))
Debug "Address of mem2: " + Str(*mem\GetMemPointer(2))
DeleteObject(*mem)
;*mem\Release()
Debug ""
GT :wink:

Posted: Wed Jun 24, 2009 11:14 pm
by mk-soft
Update v0.45

Bugfix:
- Memory manager

Sorry... Big Bug at version 0.44

Re: Another OOP PreCompiler

Posted: Mon Sep 14, 2009 12:40 am
by Sabour
WOW!!!! THANK YOU!!!!