ArrayArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2011-03-11T00:21:46+02:00 https://brainmodular.com/forums/app.php/feed/topic/2740 2011-03-11T00:21:46+02:00 2011-03-11T00:21:46+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18580#p18580 <![CDATA[Save Array to text file ; read array from text file.]]>
Hope you had fun writing it ! :)

Thanks you very much.

Statistics: Posted by moody33 — 10 Mar 2011, 23:21


]]>
2011-03-10T23:50:54+02:00 2011-03-10T23:50:54+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18579#p18579 <![CDATA[Save Array to text file ; read array from text file.]]>

CODE:

VAR pArrayIn    &#58; TParameter;VAR pArrayOut   &#58; TParameter;VAR pFileName   &#58; TParameter;VAR pWrite      &#58; TParameter;VAR pRead       &#58; TParameter;PROCEDURE Init;BEGIN   pArrayIn &#58;= CreateParam&#40;'array in', ptArray&#41;; SetIsOutput&#40;pArrayIn, FALSE&#41;;   SetMin&#40;pArrayIn, -1000000&#41;; SetMax&#40;pArrayIn, 1000000&#41;;   pArrayOut &#58;= CreateParam&#40;'array out', ptArray&#41;; SetIsInput&#40;pArrayOut, FALSE&#41;;   SetMin&#40;pArrayOut, -1000000&#41;; SetMax&#40;pArrayOut, 1000000&#41;;   pFileName &#58;= CreateParam&#40;'file name', ptTextField&#41;; SetIsOutput&#40;pFilename, FALSE&#41;;   pWrite &#58;= CreateParam&#40;'write', ptButton&#41;; SetIsOutput&#40;pWrite, FALSE&#41;;   pRead &#58;= CreateParam&#40;'read', ptButton&#41;; SetIsOutput&#40;pRead, FALSE&#41;;END;PROCEDURE Callback&#40;n &#58; Integer&#41;;   VAR i &#58; Integer;   VAR list &#58; TStringList;BEGIN   CASE n OF      pWrite &#58; BEGIN                  list &#58;= TStringList.Create;                  FOR i &#58;= 0 TO &#40;GetLength&#40;pArrayIn&#41; - 1&#41; DO                     list.Add&#40;FloatToStr&#40;GetDataArrayValue&#40;pArrayIn, i&#41;&#41;&#41;;                  list.SaveToFile&#40;GetStringValue&#40;pFileName&#41;&#41;;                  list.Free;               END;     pRead   &#58; IF &#40;FileExists&#40;GetStringValue&#40;pFileName&#41;&#41;&#41; THEN BEGIN                  list &#58;= TStringList.Create;                  list.LoadFromFile&#40;GetStringValue&#40;pFileName&#41;&#41;;                  SetLength&#40;pArrayOut, list.Count&#41;;                  FOR i &#58;= 0 TO &#40;list.Count - 1&#41; DO                     SetDataArrayValue&#40;pArrayOut, i, StrToFloat&#40;list&#91;i&#93;&#41;&#41;;                  list.Free;               END               ELSE                  WriteLn&#40;'Couldn''t open file&#58; ' + GetStringValue&#40;pFileName&#41;&#41;;   END;END; // Callback

Statistics: Posted by bsork — 10 Mar 2011, 22:50


]]>
2011-03-10T08:52:55+02:00 2011-03-10T08:52:55+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18564#p18564 <![CDATA[Save Array to text file ; read array from text file.]]>
I haven't actually decided exactly what the extra touches would be either, so new add-ons will have to wait.

Statistics: Posted by bsork — 10 Mar 2011, 07:52


]]>
2011-03-10T00:16:03+02:00 2011-03-10T00:16:03+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18557#p18557 <![CDATA[Save Array to text file ; read array from text file.]]> Statistics: Posted by moody33 — 09 Mar 2011, 23:16


]]>
2011-03-03T09:35:32+02:00 2011-03-03T09:35:32+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18344#p18344 <![CDATA[Save Array to text file ; read array from text file.]]> Statistics: Posted by bsork — 03 Mar 2011, 08:35


]]>
2011-03-03T02:15:23+02:00 2011-03-03T02:15:23+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18341#p18341 <![CDATA[Save Array to text file ; read array from text file.]]> i've already take a look at the script, but it doesn't seems to correspond to my need since there is no inputs and no ouputs, I don't really understand how to use it.

@Bsork
If you have the time, I'll be happy if you make another one of course. I've already take a look to your former text to data and it seems to content errors ( show in the console ). And it only ouput one value at a time. So , I will wait for another one if possible. :)

Statistics: Posted by moody33 — 03 Mar 2011, 01:15


]]>
2011-03-03T01:04:07+02:00 2011-03-03T01:04:07+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18338#p18338 <![CDATA[Save Array to text file ; read array from text file.]]> Statistics: Posted by senso — 03 Mar 2011, 00:04


]]>
2011-03-03T00:25:49+02:00 2011-03-03T00:25:49+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18334#p18334 <![CDATA[Save Array to text file ; read array from text file.]]>

Anyone feel free to update them, I wont have time to do anything with them before the weekend.

Statistics: Posted by bsork — 02 Mar 2011, 23:25


]]>
2011-03-02T23:07:54+02:00 2011-03-02T23:07:54+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18332#p18332 <![CDATA[Save Array to text file ; read array from text file.]]>
I need a script that could save an array to a text file, and another one that could perform the same process in reverse. So , the second one should open a txt file containing an array and extract those array to an array output. Both scripts have to read/write a large amount of array ( near 40 000 elements values) . The second one have to extract the array in one bloc size, ( should not extracts elements by an index).

Since senso have build a cool OpenDialog module, this script should be useful for everyone, and especially for me ! :D
So, if there is any candidate ( follow my eyes ;) ), I 'll be very happy !

Bisette.

Statistics: Posted by moody33 — 02 Mar 2011, 22:07


]]>
BrainModular BrainModular Users Forum 2011-03-11T00:21:46+02:00 https://brainmodular.com/forums/app.php/feed/topic/2740 2011-03-11T00:21:46+02:00 2011-03-11T00:21:46+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18580#p18580 <![CDATA[Save Array to text file ; read array from text file.]]>
Hope you had fun writing it ! :)

Thanks you very much.

Statistics: Posted by moody33 — 10 Mar 2011, 23:21


]]>
2011-03-10T23:50:54+02:00 2011-03-10T23:50:54+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18579#p18579 <![CDATA[Save Array to text file ; read array from text file.]]>

CODE:

VAR pArrayIn    &#58; TParameter;VAR pArrayOut   &#58; TParameter;VAR pFileName   &#58; TParameter;VAR pWrite      &#58; TParameter;VAR pRead       &#58; TParameter;PROCEDURE Init;BEGIN   pArrayIn &#58;= CreateParam&#40;'array in', ptArray&#41;; SetIsOutput&#40;pArrayIn, FALSE&#41;;   SetMin&#40;pArrayIn, -1000000&#41;; SetMax&#40;pArrayIn, 1000000&#41;;   pArrayOut &#58;= CreateParam&#40;'array out', ptArray&#41;; SetIsInput&#40;pArrayOut, FALSE&#41;;   SetMin&#40;pArrayOut, -1000000&#41;; SetMax&#40;pArrayOut, 1000000&#41;;   pFileName &#58;= CreateParam&#40;'file name', ptTextField&#41;; SetIsOutput&#40;pFilename, FALSE&#41;;   pWrite &#58;= CreateParam&#40;'write', ptButton&#41;; SetIsOutput&#40;pWrite, FALSE&#41;;   pRead &#58;= CreateParam&#40;'read', ptButton&#41;; SetIsOutput&#40;pRead, FALSE&#41;;END;PROCEDURE Callback&#40;n &#58; Integer&#41;;   VAR i &#58; Integer;   VAR list &#58; TStringList;BEGIN   CASE n OF      pWrite &#58; BEGIN                  list &#58;= TStringList.Create;                  FOR i &#58;= 0 TO &#40;GetLength&#40;pArrayIn&#41; - 1&#41; DO                     list.Add&#40;FloatToStr&#40;GetDataArrayValue&#40;pArrayIn, i&#41;&#41;&#41;;                  list.SaveToFile&#40;GetStringValue&#40;pFileName&#41;&#41;;                  list.Free;               END;     pRead   &#58; IF &#40;FileExists&#40;GetStringValue&#40;pFileName&#41;&#41;&#41; THEN BEGIN                  list &#58;= TStringList.Create;                  list.LoadFromFile&#40;GetStringValue&#40;pFileName&#41;&#41;;                  SetLength&#40;pArrayOut, list.Count&#41;;                  FOR i &#58;= 0 TO &#40;list.Count - 1&#41; DO                     SetDataArrayValue&#40;pArrayOut, i, StrToFloat&#40;list&#91;i&#93;&#41;&#41;;                  list.Free;               END               ELSE                  WriteLn&#40;'Couldn''t open file&#58; ' + GetStringValue&#40;pFileName&#41;&#41;;   END;END; // Callback

Statistics: Posted by bsork — 10 Mar 2011, 22:50


]]>
2011-03-10T08:52:55+02:00 2011-03-10T08:52:55+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18564#p18564 <![CDATA[Save Array to text file ; read array from text file.]]>
I haven't actually decided exactly what the extra touches would be either, so new add-ons will have to wait.

Statistics: Posted by bsork — 10 Mar 2011, 07:52


]]>
2011-03-10T00:16:03+02:00 2011-03-10T00:16:03+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18557#p18557 <![CDATA[Save Array to text file ; read array from text file.]]> Statistics: Posted by moody33 — 09 Mar 2011, 23:16


]]>
2011-03-03T09:35:32+02:00 2011-03-03T09:35:32+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18344#p18344 <![CDATA[Save Array to text file ; read array from text file.]]> Statistics: Posted by bsork — 03 Mar 2011, 08:35


]]>
2011-03-03T02:15:23+02:00 2011-03-03T02:15:23+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18341#p18341 <![CDATA[Save Array to text file ; read array from text file.]]> i've already take a look at the script, but it doesn't seems to correspond to my need since there is no inputs and no ouputs, I don't really understand how to use it.

@Bsork
If you have the time, I'll be happy if you make another one of course. I've already take a look to your former text to data and it seems to content errors ( show in the console ). And it only ouput one value at a time. So , I will wait for another one if possible. :)

Statistics: Posted by moody33 — 03 Mar 2011, 01:15


]]>
2011-03-03T01:04:07+02:00 2011-03-03T01:04:07+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18338#p18338 <![CDATA[Save Array to text file ; read array from text file.]]> Statistics: Posted by senso — 03 Mar 2011, 00:04


]]>
2011-03-03T00:25:49+02:00 2011-03-03T00:25:49+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18334#p18334 <![CDATA[Save Array to text file ; read array from text file.]]>

Anyone feel free to update them, I wont have time to do anything with them before the weekend.

Statistics: Posted by bsork — 02 Mar 2011, 23:25


]]>
2011-03-02T23:07:54+02:00 2011-03-02T23:07:54+02:00 https://brainmodular.com/forums/viewtopic.php?t=2740&p=18332#p18332 <![CDATA[Save Array to text file ; read array from text file.]]>
I need a script that could save an array to a text file, and another one that could perform the same process in reverse. So , the second one should open a txt file containing an array and extract those array to an array output. Both scripts have to read/write a large amount of array ( near 40 000 elements values) . The second one have to extract the array in one bloc size, ( should not extracts elements by an index).

Since senso have build a cool OpenDialog module, this script should be useful for everyone, and especially for me ! :D
So, if there is any candidate ( follow my eyes ;) ), I 'll be very happy !

Bisette.

Statistics: Posted by moody33 — 02 Mar 2011, 22:07


]]>