ArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2017-11-11T18:37:53+02:00 https://brainmodular.com/forums/app.php/feed/topic/5953 2017-11-11T18:37:53+02:00 2017-11-11T18:37:53+02:00 https://brainmodular.com/forums/viewtopic.php?t=5953&p=38509#p38509 <![CDATA[FastScript - Script Function Updates]]> - for pos :

CODE:

pos&#40;uppercase&#40;s1&#41;,uppercase&#40;s2&#41;&#41;
does the trick for ignore case.

- I'm not sure I understand the difference between IndexOf and Pos.

- array's

CODE:

function mystuff&#58;array of integer;    var i &#58; integer;    begin                   setArraylength&#40;result,10&#41;;  for i &#58;= 0 to 9 do result&#91;i&#93; &#58;= i;end;

Statistics: Posted by senso — 11 Nov 2017, 17:37


]]>
2017-11-11T17:05:20+02:00 2017-11-11T17:05:20+02:00 https://brainmodular.com/forums/viewtopic.php?t=5953&p=38501#p38501 <![CDATA[FastScript - Script Function Updates]]> I wish there was a Config/Script/Functions and a Config/Script/Procedure directory that we could use.
It would be nice to place these and be able to reference as our own functions and procedures.
As add-ons it would be nice to have shared scripts as well. Definitely reduce redundancy and I think make the FastScript more useful.

Thanks Oli!
I'll give it a shot.

-s

Statistics: Posted by sephult — 11 Nov 2017, 16:05


]]>
2017-11-09T22:58:22+02:00 2017-11-09T22:58:22+02:00 https://brainmodular.com/forums/viewtopic.php?t=5953&p=38496#p38496 <![CDATA[FastScript - Script Function Updates]]>
https://www.freepascal.org/docs-html/rt ... rcase.html

Statistics: Posted by oli_lab — 09 Nov 2017, 21:58


]]>
2017-11-09T21:45:28+02:00 2017-11-09T21:45:28+02:00 https://brainmodular.com/forums/viewtopic.php?t=5953&p=38495#p38495 <![CDATA[FastScript - Script Function Updates]]>
So my workaround also may not be possible. But I would love some sort of 'include' function, that could load some procedures that I always like to have in my scripts..... if that were possible, you could create your own methods to do these things, and not have to paste them into every script.

Statistics: Posted by woodslanding — 09 Nov 2017, 20:45


]]>
2017-11-05T17:16:19+02:00 2017-11-05T17:16:19+02:00 https://brainmodular.com/forums/viewtopic.php?t=5953&p=38465#p38465 <![CDATA[FastScript - Script Function Updates]]> String Manipulation Suggestions:

pos ( ) :integer
I think it would be useful to add an argument to the pos( ) string position search function to ignore the case. It does not seem there is a good method to search while ignoring the case.

TString IndexOf
The TString.indexOf would benefit greatly from a sub-string search, as well as the ignore case argument as described above for the pos ( ).

These two search functions if updated I believe would enhance the String Manipulation greatly in the Fastscripts.

Also,
I don't think I've ever seen a function return an array. Is this because of issues with dynamic array sizing? Can functions pass :array of integer, etc...
I was also thinking that beyond a positional search that possibly there could be
a more detailed string search. Example

--------------------------------------------------------------------------------------------------------------------
function StrSearch(source: string, sub :string, ignoreCase :bool): array of Int32;
--------------------------------------------------------------------------------------------------------------------
You could then search for the substring (sub) within the (source) text, using True to ignore the case. The result will find the first position and the last match of the sub-string and return the index positions in an array of Result [0..1].
PSEUDO

CODE:

var result           &#58; array &#91;0..1&#93; of integer;var inputString    &#58;string;inputString &#58;= 'This is where the password starts'';result &#58;= StrSearch&#40; inputString , 'Pass' ,  1 &#41;;//result&#91;0&#93; returns = 19 where 'p' begins regardless of case.//result&#91;1&#93; returns = 22 because 'pass' ended at position 22_ //irregardless of 'password'//Alternately, result&#91;2&#93; could be the count of matches
The results of this would be much more compatible with other string manipulation functions like the Copy who expects position and count where you could easily extract.

Just some ideas and suggestions I wanted to share. Doing some scripting and sometimes these things just got to write down. :D

-s

Statistics: Posted by sephult — 05 Nov 2017, 16:16


]]>
BrainModular BrainModular Users Forum 2017-11-11T18:37:53+02:00 https://brainmodular.com/forums/app.php/feed/topic/5953 2017-11-11T18:37:53+02:00 2017-11-11T18:37:53+02:00 https://brainmodular.com/forums/viewtopic.php?t=5953&p=38509#p38509 <![CDATA[FastScript - Script Function Updates]]> - for pos :

CODE:

pos&#40;uppercase&#40;s1&#41;,uppercase&#40;s2&#41;&#41;
does the trick for ignore case.

- I'm not sure I understand the difference between IndexOf and Pos.

- array's

CODE:

function mystuff&#58;array of integer;    var i &#58; integer;    begin                   setArraylength&#40;result,10&#41;;  for i &#58;= 0 to 9 do result&#91;i&#93; &#58;= i;end;

Statistics: Posted by senso — 11 Nov 2017, 17:37


]]>
2017-11-11T17:05:20+02:00 2017-11-11T17:05:20+02:00 https://brainmodular.com/forums/viewtopic.php?t=5953&p=38501#p38501 <![CDATA[FastScript - Script Function Updates]]> I wish there was a Config/Script/Functions and a Config/Script/Procedure directory that we could use.
It would be nice to place these and be able to reference as our own functions and procedures.
As add-ons it would be nice to have shared scripts as well. Definitely reduce redundancy and I think make the FastScript more useful.

Thanks Oli!
I'll give it a shot.

-s

Statistics: Posted by sephult — 11 Nov 2017, 16:05


]]>
2017-11-09T22:58:22+02:00 2017-11-09T22:58:22+02:00 https://brainmodular.com/forums/viewtopic.php?t=5953&p=38496#p38496 <![CDATA[FastScript - Script Function Updates]]>
https://www.freepascal.org/docs-html/rt ... rcase.html

Statistics: Posted by oli_lab — 09 Nov 2017, 21:58


]]>
2017-11-09T21:45:28+02:00 2017-11-09T21:45:28+02:00 https://brainmodular.com/forums/viewtopic.php?t=5953&p=38495#p38495 <![CDATA[FastScript - Script Function Updates]]>
So my workaround also may not be possible. But I would love some sort of 'include' function, that could load some procedures that I always like to have in my scripts..... if that were possible, you could create your own methods to do these things, and not have to paste them into every script.

Statistics: Posted by woodslanding — 09 Nov 2017, 20:45


]]>
2017-11-05T17:16:19+02:00 2017-11-05T17:16:19+02:00 https://brainmodular.com/forums/viewtopic.php?t=5953&p=38465#p38465 <![CDATA[FastScript - Script Function Updates]]> String Manipulation Suggestions:

pos ( ) :integer
I think it would be useful to add an argument to the pos( ) string position search function to ignore the case. It does not seem there is a good method to search while ignoring the case.

TString IndexOf
The TString.indexOf would benefit greatly from a sub-string search, as well as the ignore case argument as described above for the pos ( ).

These two search functions if updated I believe would enhance the String Manipulation greatly in the Fastscripts.

Also,
I don't think I've ever seen a function return an array. Is this because of issues with dynamic array sizing? Can functions pass :array of integer, etc...
I was also thinking that beyond a positional search that possibly there could be
a more detailed string search. Example

--------------------------------------------------------------------------------------------------------------------
function StrSearch(source: string, sub :string, ignoreCase :bool): array of Int32;
--------------------------------------------------------------------------------------------------------------------
You could then search for the substring (sub) within the (source) text, using True to ignore the case. The result will find the first position and the last match of the sub-string and return the index positions in an array of Result [0..1].
PSEUDO

CODE:

var result           &#58; array &#91;0..1&#93; of integer;var inputString    &#58;string;inputString &#58;= 'This is where the password starts'';result &#58;= StrSearch&#40; inputString , 'Pass' ,  1 &#41;;//result&#91;0&#93; returns = 19 where 'p' begins regardless of case.//result&#91;1&#93; returns = 22 because 'pass' ended at position 22_ //irregardless of 'password'//Alternately, result&#91;2&#93; could be the count of matches
The results of this would be much more compatible with other string manipulation functions like the Copy who expects position and count where you could easily extract.

Just some ideas and suggestions I wanted to share. Doing some scripting and sometimes these things just got to write down. :D

-s

Statistics: Posted by sephult — 05 Nov 2017, 16:16


]]>