Page 1 of 1

'Static' statement question

Posted: Thu Dec 12, 2024 11:38 pm
by Olli
I frequently use this syntax :

Code: Select all

Procedure classMethodX(*this.class)
With *this
  ; ...
EndWith
EndProcedure
Two specific procedures are ever added :

Code: Select all

Procedure classCreate()
  Protected *this.class
  *this = AllocateMemory(SizeOf(class) )
  ProcedureReturn *this
EndProcedure

Procedure classDestroy(*this.class)
   FreeMemory(*this)
EndProcedure
I would like to compress all the methods of the same class, all in one single procedure.

If I test for only one instance, I have near nothing to do : I just replace Protected with Static.

Is Static a right directive to start any instances ?