Raised This Month: $ Target: $400
 0% 

Converting enum elements


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
thEsp
BANNED
Join Date: Aug 2017
Old 06-08-2020 , 14:31   Converting enum elements
Reply With Quote #1

Hello. As the title says most of it, is there any way to convert enum elements to a certain string? I did search a lot before coming to ask here, even in other Pawn forums. In fact I've been hassling with this for more than 4 straight hours. Unfortunately I couldn't find anything helpful at all. After some time of researching I thought a pre-processor functionality from C (which I suppose is missing in Pawn) called "stringification" would help me, but that was something completely distinct and I realized it much later.

If you don't understand, here's what I mean:
Code:
enum MyEnumThingy // <- don't get confused by this name please, it's a totally random thing (example) {      Red,      Blue }; // ... new szEnumName[] = ENUM_NAME(Red /* Element value */, MyEnumThingy /* Enumerator */); // szEnumName = "Red"

That's not something natives can do so I'm counting on a hackish macro-function, if even possible...
thEsp is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode