View Single Post
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 06-24-2015 , 15:31   Re: [INC] DString - Dynamic Strings
Reply With Quote #6

Quote:
Originally Posted by Eun View Post
I appreciate your changes.
But there are some problems:

I guess you should not limit the Developer to an "arbitrarily high" buffer. Thats not the use case of this Module. This Module should give you the theoretical possibility to use string with an unspecified length.
You just limited it to 4084

The buffer was especially designed just for AddEx, since we cannot be dynamic on Formatting issues.

Additionaly you never should fill buffers in a Length call. Length operations should be as little as possible.

However, I added the MethodMap.
The attached version now packs a length cell, removing the length cap from before.

DSTRING_BUFFERLEN is now only used with VFormat. (ie. Format and AddEx functions)

Per WildCard65, length is a property and no longer uses the buffer. Also, added double inclusion block and changed function name cases.

Furthermore, DString inherits the DataPack methodmap, demonstrating dual methodmap usage.

Edit: Attachment outdated, see post below.
Attached Files
File Type: inc dstring.inc (2.9 KB, 209 views)

Last edited by Emp`; 07-31-2016 at 15:09. Reason: attachment outdated
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`