From OpenSCADAWiki
Jump to: navigation, search
(Importing a new version from external source)
(Importing a new version from external source)
 
Line 7: Line 7:
 
* ''ElTp shift( );'' — shifts of the array to the top. The first element is removed and its value is returned.
 
* ''ElTp shift( );'' — shifts of the array to the top. The first element is removed and its value is returned.
 
* ''int unshift( ElTp var, ... );'' — shifts element(s) ''var'' to the array. The first element to the 0, second to the 1 and so on.
 
* ''int unshift( ElTp var, ... );'' — shifts element(s) ''var'' to the array. The first element to the 0, second to the 1 and so on.
* ''Array slice( int beg, int end );'' — returns an array fragment from ''beg'' to ''end'' (exclude). If the value of beginning or end is negative, then the count is made from the end of the array. If the end is not specified, then the end is the end of the array.
+
* ''Array slice( int beg, int end = {end} );'' — returns an array fragment from ''beg'' to ''end'' (exclude). If the value of beginning or end is negative, then the count is made from the end of the array.
* ''Array splice( int beg, int remN, ElTp val1, ElTp val2, ... );'' — inserts, deletes or replaces the elements of the array. Returns the removed elements array. Firstly it is made the removing of elements from the position ''beg'' and in the quantity of ''remN'', and then the values ''val1'' are inserted and so on, beginning from the position ''beg''.
+
* ''Array splice( int beg, int remN = {end}[, ElTp val1[, ElTp val2, ...]] );'' — deletes the elements from ''beg'' in quantity ''remN'' and next inserts the elements ''val1, val2, ...'' to the array. Returns the removed elements' array.
 
* ''int indexOf( ElTp var, int start = 0 );'' — returns the array index of the required variable ''var'' in the original row from the position ''start''. If the initial position is not specified then the search starts from the beginning. If the search variable is not found then "-1" is returned.
 
* ''int indexOf( ElTp var, int start = 0 );'' — returns the array index of the required variable ''var'' in the original row from the position ''start''. If the initial position is not specified then the search starts from the beginning. If the search variable is not found then "-1" is returned.
 
* ''int lastIndexOf( ElTp var, int start = {end} );'' — returns the array index of the required variable ''var'' in the original row from the position ''start'' when searching from the end. If the initial position is not specified then the search begins from the end. If the search variable is not found then "-1" is returned.
 
* ''int lastIndexOf( ElTp var, int start = {end} );'' — returns the array index of the required variable ''var'' in the original row from the position ''start'' when searching from the end. If the initial position is not specified then the search begins from the end. If the search variable is not found then "-1" is returned.
* ''double sum(int beg, int end);'' — sum of the array values part from the position ''beg'' to ''end'', excluding.
+
* ''double sum(int beg, int end = {end});'' — sum of the array values part from the position ''beg'' to ''end'', excluding.
 
* ''Array sort( );'' — sorts array elements in the lexicographical order.
 
* ''Array sort( );'' — sorts array elements in the lexicographical order.

Latest revision as of 19:25, 9 April 2025

Information about message (contribute)
This message has no documentation. If you know where or how this message is used, you can help other translators by adding documentation to this message.
Message definition (Documents/User API)
Array provides the special property "length" to get the array size "'''var = arr.length;'''". Also array provides the following functions:
* ''string join( string sep = "," )'', ''string toString( string sep = "," )'', ''string valueOf( string sep = "," )'' — returns the string with the array elements separated by ''sep'' or the character ','.
* ''Array concat( Array arr );'' — adds to the initial array the elements of the ''arr'' array. Returns the initial array with changes.
* ''int push( ElTp var, ... );'' — places the element(s) ''var'' to the end of the array, as to the stack. Returns the new array size.
* ''ElTp pop( );'' — deletes of the last element of the array and returns of its value, as from the stack.
* ''Array reverse( );'' — changes the order of the elements of the array. Returns the initial array with the changes.
* ''ElTp shift( );'' — shifts of the array to the top. The first element is removed and its value is returned.
* ''int unshift( ElTp var, ... );'' — shifts element(s) ''var'' to the array. The first element to the 0, second to the 1 and so on.
* ''Array slice( int beg, int end = {end} );'' — returns an array fragment from ''beg'' to ''end'' (exclude). If the value of beginning or end is negative, then the count is made from the end of the array.
* ''Array splice( int beg, int remN = {end}[, ElTp val1[, ElTp val2, ...]] );'' — deletes the elements from ''beg'' in quantity ''remN'' and next inserts the elements ''val1, val2, ...'' to the array. Returns the removed elements' array.
* ''int indexOf( ElTp var, int start = 0 );'' — returns the array index of the required variable ''var'' in the original row from the position ''start''. If the initial position is not specified then the search starts from the beginning. If the search variable is not found then "-1" is returned.
* ''int lastIndexOf( ElTp var, int start = {end} );'' — returns the array index of the required variable ''var'' in the original row from the position ''start'' when searching from the end. If the initial position is not specified then the search begins from the end. If the search variable is not found then "-1" is returned.
* ''double sum(int beg, int end = {end});'' — sum of the array values part from the position ''beg'' to ''end'', excluding.
* ''Array sort( );'' — sorts array elements in the lexicographical order.
TranslationArray provides the special property "length" to get the array size "'''var = arr.length;'''". Also array provides the following functions:
* ''string join( string sep = "," )'', ''string toString( string sep = "," )'', ''string valueOf( string sep = "," )'' — returns the string with the array elements separated by ''sep'' or the character ','.
* ''Array concat( Array arr );'' — adds to the initial array the elements of the ''arr'' array. Returns the initial array with changes.
* ''int push( ElTp var, ... );'' — places the element(s) ''var'' to the end of the array, as to the stack. Returns the new array size.
* ''ElTp pop( );'' — deletes of the last element of the array and returns of its value, as from the stack.
* ''Array reverse( );'' — changes the order of the elements of the array. Returns the initial array with the changes.
* ''ElTp shift( );'' — shifts of the array to the top. The first element is removed and its value is returned.
* ''int unshift( ElTp var, ... );'' — shifts element(s) ''var'' to the array. The first element to the 0, second to the 1 and so on.
* ''Array slice( int beg, int end = {end} );'' — returns an array fragment from ''beg'' to ''end'' (exclude). If the value of beginning or end is negative, then the count is made from the end of the array.
* ''Array splice( int beg, int remN = {end}[, ElTp val1[, ElTp val2, ...]] );'' — deletes the elements from ''beg'' in quantity ''remN'' and next inserts the elements ''val1, val2, ...'' to the array. Returns the removed elements' array.
* ''int indexOf( ElTp var, int start = 0 );'' — returns the array index of the required variable ''var'' in the original row from the position ''start''. If the initial position is not specified then the search starts from the beginning. If the search variable is not found then "-1" is returned.
* ''int lastIndexOf( ElTp var, int start = {end} );'' — returns the array index of the required variable ''var'' in the original row from the position ''start'' when searching from the end. If the initial position is not specified then the search begins from the end. If the search variable is not found then "-1" is returned.
* ''double sum(int beg, int end = {end});'' — sum of the array values part from the position ''beg'' to ''end'', excluding.
* ''Array sort( );'' — sorts array elements in the lexicographical order.

Array provides the special property "length" to get the array size "var = arr.length;". Also array provides the following functions:

  • string join( string sep = "," ), string toString( string sep = "," ), string valueOf( string sep = "," ) — returns the string with the array elements separated by sep or the character ','.
  • Array concat( Array arr ); — adds to the initial array the elements of the arr array. Returns the initial array with changes.
  • int push( ElTp var, ... ); — places the element(s) var to the end of the array, as to the stack. Returns the new array size.
  • ElTp pop( ); — deletes of the last element of the array and returns of its value, as from the stack.
  • Array reverse( ); — changes the order of the elements of the array. Returns the initial array with the changes.
  • ElTp shift( ); — shifts of the array to the top. The first element is removed and its value is returned.
  • int unshift( ElTp var, ... ); — shifts element(s) var to the array. The first element to the 0, second to the 1 and so on.
  • Array slice( int beg, int end = {end} ); — returns an array fragment from beg to end (exclude). If the value of beginning or end is negative, then the count is made from the end of the array.
  • Array splice( int beg, int remN = {end}[, ElTp val1[, ElTp val2, ...]] ); — deletes the elements from beg in quantity remN and next inserts the elements val1, val2, ... to the array. Returns the removed elements' array.
  • int indexOf( ElTp var, int start = 0 ); — returns the array index of the required variable var in the original row from the position start. If the initial position is not specified then the search starts from the beginning. If the search variable is not found then "-1" is returned.
  • int lastIndexOf( ElTp var, int start = {end} ); — returns the array index of the required variable var in the original row from the position start when searching from the end. If the initial position is not specified then the search begins from the end. If the search variable is not found then "-1" is returned.
  • double sum(int beg, int end = {end}); — sum of the array values part from the position beg to end, excluding.
  • Array sort( ); — sorts array elements in the lexicographical order.