Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pascal : What's the difference between random(); and random;

Whether I use random or random(), I 'seem' to get the same results. Now, coming from a Python background, using random() seems more natural and convenient to me, but I've seen random being used plenty a times.

Neither statements produce a hint or a warning using FPC's appropriate flags.

So, is there a difference, and if yes, what is it?

like image 425
Thomas Orozco Avatar asked Feb 22 '26 15:02

Thomas Orozco


1 Answers

There's no difference. Pascal doesn't require the parentheses when calling functions without parameters. You can use them to make your code more clear when reading it, but they're entirely optional.

like image 88
Ken White Avatar answered Feb 26 '26 05:02

Ken White



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!