UndefineStructure, UndefineConstant

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Toni6
User
User
Posts: 45
Joined: Mon Apr 23, 2012 1:39 pm

UndefineStructure, UndefineConstant

Post by Toni6 »

It would be quite useful to have these 2 features available in certain situations/projects.

Example - UndefineStructure:

Code: Select all

Structure PB_Default_Player
  var1.l
  var2.f
EndStructure

CompilerIf Defined(PB_Default_Player, #PB_Structure)
  UndefineStructure PB_Default_Player
  
  Structure PB_Default_Player
    score.l
    pos.f
  EndStructure
CompilerEndIf
Example - UndefineConstant:

Code: Select all

#SOME_CONSTANT = 9

CompilerIf Defined(#SOME_CONSTANT, #PB_Constant)
  UndefineConstant SOME_CONSTANT
  
  #SOME_CONSTANT = 33
CompilerEndIf