[Implemented] Macro call count

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
technicorn
Enthusiast
Enthusiast
Posts: 105
Joined: Wed Jan 18, 2006 7:40 pm
Location: Hamburg

[Implemented] Macro call count

Post by technicorn »

It would be nice to have a name that would be replaced by the number
of times a macro is used:

Code: Select all

Macro TestIt(x,y)
  MOV eax,x
  CMP eax,y
  JE l_ok#MacroCallCount
  CALL ErrorRoutine
ok#MacroCallCount:
EndMacro
Would become:
First time TestIt(vara,123) ->

Code: Select all

  MOV eax,vara
  CMP eax,123
  JE l_ok1
  CALL ErrorRoutine
ok1:
Second time: TestIt(varb,456) ->

Code: Select all

  MOV eax,varb
  CMP eax,456
  JE l_ok2
  CALL ErrorRoutine
ok2:
MacroCallCount shouldn't be a PB constant, because it couldn't be
pasted with #

Of course it should be a counter that is privat to each macro.
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

Post by Nik »

Good Idea but I wouldn't call it macrocallcount as macrso are simply not called, but maybe #MacroUseNumber
Post Reply