<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to call DLL function with String Array and receive Double Array data? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-call-DLL-function-with-String-Array-and-receive-Double/m-p/703728#M88794</link>
    <description>&lt;P&gt;I had read the content of charter 14 in scripting guide, and did some test about my C function.&lt;BR /&gt;The attachment testdll.jsl works fine with simple data, like AnsiString (in and out). In the log I can see:&lt;/P&gt;&lt;P&gt;---&lt;BR /&gt;dll_obj = DLL("C:\Users\charlie.chu\Documents\JMP\JSL\jmptest2.dll");&lt;BR /&gt;[CDECL] AnsiString testFunc(AnsiString);&lt;BR /&gt;result = "ABC";&lt;BR /&gt;---&lt;BR /&gt;My question is, if I want to sent data like {"1.2, 2.3, 3.4", "5.6, 6.7, 7.8"}, and finally recieve the return data like { {1.2, 2.3, 3.4} , {5.6, 6.7, 7.8} }.&amp;nbsp;How should I do? I can not find a suitable data type.&lt;/P&gt;&lt;P&gt;In the C code, the function strSplit is defined with&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;double&lt;/SPAN&gt;&lt;SPAN&gt;**&lt;/SPAN&gt; &lt;SPAN&gt;strSplit&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;char&lt;/SPAN&gt;&lt;SPAN&gt;**&lt;/SPAN&gt; &lt;SPAN&gt;strArray&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;I can not use AnsiString, but ObjPtr is also failed.&amp;nbsp;&lt;BR /&gt;PS: I found the c language code can not be an attachment file.....&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 29 Nov 2023 00:13:42 GMT</pubDate>
    <dc:creator>Charlie_Chu</dc:creator>
    <dc:date>2023-11-29T00:13:42Z</dc:date>
    <item>
      <title>How to call DLL function with String Array and receive Double Array data?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-call-DLL-function-with-String-Array-and-receive-Double/m-p/703728#M88794</link>
      <description>&lt;P&gt;I had read the content of charter 14 in scripting guide, and did some test about my C function.&lt;BR /&gt;The attachment testdll.jsl works fine with simple data, like AnsiString (in and out). In the log I can see:&lt;/P&gt;&lt;P&gt;---&lt;BR /&gt;dll_obj = DLL("C:\Users\charlie.chu\Documents\JMP\JSL\jmptest2.dll");&lt;BR /&gt;[CDECL] AnsiString testFunc(AnsiString);&lt;BR /&gt;result = "ABC";&lt;BR /&gt;---&lt;BR /&gt;My question is, if I want to sent data like {"1.2, 2.3, 3.4", "5.6, 6.7, 7.8"}, and finally recieve the return data like { {1.2, 2.3, 3.4} , {5.6, 6.7, 7.8} }.&amp;nbsp;How should I do? I can not find a suitable data type.&lt;/P&gt;&lt;P&gt;In the C code, the function strSplit is defined with&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;double&lt;/SPAN&gt;&lt;SPAN&gt;**&lt;/SPAN&gt; &lt;SPAN&gt;strSplit&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;char&lt;/SPAN&gt;&lt;SPAN&gt;**&lt;/SPAN&gt; &lt;SPAN&gt;strArray&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;I can not use AnsiString, but ObjPtr is also failed.&amp;nbsp;&lt;BR /&gt;PS: I found the c language code can not be an attachment file.....&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 29 Nov 2023 00:13:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-call-DLL-function-with-String-Array-and-receive-Double/m-p/703728#M88794</guid>
      <dc:creator>Charlie_Chu</dc:creator>
      <dc:date>2023-11-29T00:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to call DLL function with String Array and receive Double Array data?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-call-DLL-function-with-String-Array-and-receive-Double/m-p/704062#M88817</link>
      <description>&lt;P&gt;You could be running into some issues mentioned here &lt;A href="https://community.jmp.com/t5/Discussions/Does-anyone-know-about-TDMS-format-data-converting-into-JMP/m-p/367590/highlight/true#M61750" target="_blank"&gt;https://community.jmp.com/t5/Discussions/Does-anyone-know-about-TDMS-format-data-converting-into-JMP/m-p/367590/highlight/true#M61750&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wish list item &lt;LI-MESSAGE title="Extend the support of arrays in JMP's DLL capabilities beyond double" uid="474573" url="https://community.jmp.com/t5/JMP-Wish-List/Extend-the-support-of-arrays-in-JMP-s-DLL-capabilities-beyond/m-p/474573#U474573" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 17:28:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-call-DLL-function-with-String-Array-and-receive-Double/m-p/704062#M88817</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-29T17:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to call DLL function with String Array and receive Double Array data?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-call-DLL-function-with-String-Array-and-receive-Double/m-p/704140#M88819</link>
      <description>&lt;P&gt;Thanks. So the conclusion is: No solution so far.&lt;BR /&gt;I will try send data from JMP with TCPIP socket instead of calling DLL function, it will be obviously slower...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 00:44:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-call-DLL-function-with-String-Array-and-receive-Double/m-p/704140#M88819</guid>
      <dc:creator>CharlieChu</dc:creator>
      <dc:date>2023-11-30T00:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to call DLL function with String Array and receive Double Array data?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-call-DLL-function-with-String-Array-and-receive-Double/m-p/704569#M88873</link>
      <description>&lt;P&gt;Maybe try repackaging your arguments before sending to your C codes:&lt;/P&gt;
&lt;P&gt;1) A long string, which is a concatenation of all your string&lt;/P&gt;
&lt;P&gt;2) A numerical array, elements record either the lengths of individual strings, or offsets of individual string&lt;/P&gt;
&lt;P&gt;And your C codes need to unpack them.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 01:08:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-call-DLL-function-with-String-Array-and-receive-Double/m-p/704569#M88873</guid>
      <dc:creator>peng_liu</dc:creator>
      <dc:date>2023-12-01T01:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to call DLL function with String Array and receive Double Array data?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-call-DLL-function-with-String-Array-and-receive-Double/m-p/704839#M88911</link>
      <description>&lt;P&gt;If your objective is to convert your string to a list of lists, you could do that in JSL.&amp;nbsp; Here are two approaches:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Given this string:
a = {"1.2, 2.3, 3.4", "5.6, 6.7, 7.8"};

// Return data like { {1.2, 2.3, 3.4} , {5.6, 6.7, 7.8} }

// Parse things apart
new_list = {};
m = 0;

for (i = 1, i &amp;lt;= nitems(a), i++,
	one_list = words(a[i], ", ");
	for (k = 1, k &amp;lt;= nitems(one_list), k++,
		one_list[k] = num(one_list[k]);
	);
	m++;
	new_list[m] = one_list;
);

print(new_list);

// Use matrix operators
exec_string = "new_mat = matrix({";
for (i = 1, i &amp;lt;= nitems(a), i++,
	if (i == 1,
		exec_string = exec_string || "{" || a[i] || "}";
	,
		exec_string = exec_string || ", {" || a[i] || "}";
	);
);

exec_string = exec_string || "})";
eval(parse(exec_string));

print(new_mat);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The first one returns:&lt;/P&gt;
&lt;PRE&gt;{{1.2, 2.3, 3.4}, {5.6, 6.7, 7.8}}&lt;/PRE&gt;
&lt;P&gt;The second one returns a matrix:&lt;/P&gt;
&lt;PRE&gt;[1.2 2.3 3.4, 5.6 6.7 7.8]&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Dec 2023 14:30:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-call-DLL-function-with-String-Array-and-receive-Double/m-p/704839#M88911</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2023-12-01T14:30:32Z</dc:date>
    </item>
  </channel>
</rss>

