'Static' statement question

Just starting out? Need help? Post your questions and find answers here.
Olli
Addict
Addict
Posts: 1264
Joined: Wed May 27, 2020 12:26 pm

'Static' statement question

Post 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 ?