D
D
Dima Sokolov2016-02-03 22:55:26
Delphi
Dima Sokolov, 2016-02-03 22:55:26

Is there an analogue of define in Delphi from C++?

Need define from C++ to improve the readability of the code.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2016-02-03
@dimka11

Reserved constants:
True (Boolean type);
False (Boolean type);
MaxInt(type Integer);
MaxLongint (type Integer).
Using these constants can be dangerous if you're working with someone else's code. This is due to the fact that these constants can be redefined. Remember the old joke?
So, the same thing can be done in Delphi.

const
  False{: Boolean} = Boolean( -1 );
  True{: Boolean} = Boolean( 0 );

Be carefull! Good luck with programming!

G
GavriKos, 2016-02-03
@GavriKos

www.delphibasics.ru/$Define.php - the first link in Google.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question