[amx-netlinx-common] r40 committed - Created wiki page through web user interface.

8 views
Skip to first unread message

amx-netli...@googlecode.com

unread,
Nov 10, 2010, 11:28:30 AM11/10/10
to netlinx-comm...@googlegroups.com
Revision: 40
Author: trueamx
Date: Wed Nov 10 08:28:00 2010
Log: Created wiki page through web user interface.
http://code.google.com/p/amx-netlinx-common/source/detail?r=40

Added:
/wiki/explode_quoted.wiki

=======================================
--- /dev/null
+++ /wiki/explode_quoted.wiki Wed Nov 10 08:28:00 2010
@@ -0,0 +1,57 @@
+#summary Function information for explode_quoted
+
+=explode_quoted=
+
+== Description ==
+
+|| integer *explode_quoted* (char *delim*, char *a{{{[]}}}*, char
*ret{{{[][]}}}*, integer *ret_len*, char *quote*) ||
+
+Explodes a string with a delimiter of type *char* (such as a space) into
an array of substrings, while honoring and not exploding data surrounded by
quotes.
+
+Due to NetLinx bugs, you must specify the array count of *ret* in
*ret_len* if you want the returned array sanitized. Otherwise, any extra
data present in the array will not be cleared.
+
+==Parameters==
+|| char *delim* || The delimiter used between the exploded substrings,
such as a space. ||
+|| char *a{{{[]}}}* || The string to explode. ||
+|| char *ret{{{[][]}}}* || The exploded string. ||
+|| integer *ret_len* || The amount of entries in *ret*. If this is set,
values in *ret* that are not filled with exploded substrings will be
cleared out, up to and including this count. ||
+|| char *quote* || The quoting character, of which contents enclosed are
not subject to being exploded by the delimiter. Pass 0 to disable this
functionality. ||
+
+==Examples==
+The following code explodes two variables, and shows what the exploded
variable will contain after the *explode_quoted* function is called.
+
+{{{
+define_variable
+char foo[] = 'This string will be split into 8 parts.'
+char bar[] = 'This string, "the best string," will be split into 9 parts."
+char ret[10][100]
+
+define_start
+{
+ // explode the first string
+ explode_quoted(' ', foo, ret, 10, '"')
+ /* RESULTS IN...
+ ret[1] == 'This'
+ ret[2] == 'string'
+ ret[3] == 'will'
+ ...
+ ret[8] == 'parts.'
+ */
+
+ // explode the second string
+ explode_quoted(' ', bar, ret, 10, '"')
+ /* RESULTS IN...
+ ret[1] == 'This'
+ ret[2] == 'string,'
+ ret[3] == 'the best string,'
+ ret[4] == 'will'
+ ret[5] == 'be'
+ ...
+ ret[9] == 'parts.'
+ */
+}
+}}}
+
+==Return Values==
+
+Returns the count of exploded substrings that have been placed into *ret*.
This count does not include any sanitization of *ret*.

Reply all
Reply to author
Forward
0 new messages