• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Function overloading?
#2
It is possible using some macroes and tags to specifically match a "sub-pattern", here's an example:

https://github.com/pBlueG/SA-MP-MySQL/bl...#L185-L189

The thing with tags is that it allows you to define more than one macro replacement for a function (it is technically recognized as different because of the tags). This example macro will match a literal string and variables tagged with "string:" (the tag will be removed during compilation, it's needed because there's no reliable way to detect that a variable contains a string), and it will automatically use cache_get_value_name for them, and anything else will use cache_get_value_index.

I barely know the concept so I might be a bit wrong, but that's the basic concept and it works!
  Reply


Messages In This Thread
Function overloading? - by mr_sacrimoni - 2019-04-13, 06:31 AM
RE: Function overloading? - by Graber - 2019-04-13, 12:12 PM
RE: Function overloading? - by mr_sacrimoni - 2019-04-13, 03:49 PM

Forum Jump: