#PB_Macro for Defined() compiler function

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

#PB_Macro for Defined() compiler function

Post by Guimauve »

Hello everyone,

With Defined() compiler function it's possible to define almost everything except macros. A code like this one for example don't work :

Code: Select all

CompilerIf Defined(GadgetDown, #PB_Macro) = 0
  
  Macro GadgetDown(GadgetID, Gap = 0)
    (GadgetY(GadgetID) + GadgetHeight(GadgetID) + (Gap))
  EndMacro
  
CompilerEndIf
For the moment, I convert all macro to procedure or I manage the macro definition manually as a workaround but adding Macro management to Defined() compiler function can be useful.

Best regards
Guimauve
Dear Optimist, Pessimist,
and Realist,

While you guys were
busy arguing about the
glass of water, I DRANK IT !

Sincerely,
the Opportunist
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: #PB_Macro for Defined() compiler function

Post by jassing »

+1 for that ...
User avatar
STARGÅTE
Addict
Addict
Posts: 2227
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: #PB_Macro for Defined() compiler function

Post by STARGÅTE »

has been already discussed
Defined(Foo, #PB_Macro) ?
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
Post Reply