PINE LIBRARY

arrays

137
Library "arrays"
Supplementary array methods.

method delete(arr, index)
  remove int object from array of integers at specific index
  Namespace types: array<int>
  Parameters:
    arr (array<int>): int array
    index (int): index at which int object need to be removed
  Returns: void

method delete(arr, index)
  remove float object from array of float at specific index
  Namespace types: array<float>
  Parameters:
    arr (array<float>): float array
    index (int): index at which float object need to be removed
  Returns: float

method delete(arr, index)
  remove bool object from array of bool at specific index
  Namespace types: array<bool>
  Parameters:
    arr (array<bool>): bool array
    index (int): index at which bool object need to be removed
  Returns: bool

method delete(arr, index)
  remove string object from array of string at specific index
  Namespace types: array<string>
  Parameters:
    arr (array<string>): string array
    index (int): index at which string object need to be removed
  Returns: string

method delete(arr, index)
  remove color object from array of color at specific index
  Namespace types: array<color>
  Parameters:
    arr (array<color>): color array
    index (int): index at which color object need to be removed
  Returns: color

method delete(arr, index)
  remove chart.point object from array of chart.point at specific index
  Namespace types: array<chart.point>
  Parameters:
    arr (array<chart.point>): chart.point array
    index (int): index at which chart.point object need to be removed
  Returns: void

method delete(arr, index)
  remove line object from array of lines at specific index and deletes the line
  Namespace types: array<line>
  Parameters:
    arr (array<line>): line array
    index (int): index at which line object need to be removed and deleted
  Returns: void

method delete(arr, index)
  remove label object from array of labels at specific index and deletes the label
  Namespace types: array<label>
  Parameters:
    arr (array<label>): label array
    index (int): index at which label object need to be removed and deleted
  Returns: void

method delete(arr, index)
  remove box object from array of boxes at specific index and deletes the box
  Namespace types: array<box>
  Parameters:
    arr (array<box>): box array
    index (int): index at which box object need to be removed and deleted
  Returns: void

method delete(arr, index)
  remove table object from array of tables at specific index and deletes the table
  Namespace types: array<table>
  Parameters:
    arr (array<table>): table array
    index (int): index at which table object need to be removed and deleted
  Returns: void

method delete(arr, index)
  remove linefill object from array of linefills at specific index and deletes the linefill
  Namespace types: array<linefill>
  Parameters:
    arr (array<linefill>): linefill array
    index (int): index at which linefill object need to be removed and deleted
  Returns: void

method delete(arr, index)
  remove polyline object from array of polylines at specific index and deletes the polyline
  Namespace types: array<polyline>
  Parameters:
    arr (array<polyline>): polyline array
    index (int): index at which polyline object need to be removed and deleted
  Returns: void

method popr(arr)
  remove last int object from array
  Namespace types: array<int>
  Parameters:
    arr (array<int>): int array
  Returns: int

method popr(arr)
  remove last float object from array
  Namespace types: array<float>
  Parameters:
    arr (array<float>): float array
  Returns: float

method popr(arr)
  remove last bool object from array
  Namespace types: array<bool>
  Parameters:
    arr (array<bool>): bool array
  Returns: bool

method popr(arr)
  remove last string object from array
  Namespace types: array<string>
  Parameters:
    arr (array<string>): string array
  Returns: string

method popr(arr)
  remove last color object from array
  Namespace types: array<color>
  Parameters:
    arr (array<color>): color array
  Returns: color

method popr(arr)
  remove last chart.point object from array
  Namespace types: array<chart.point>
  Parameters:
    arr (array<chart.point>): chart.point array
  Returns: void

method popr(arr)
  remove and delete last line object from array
  Namespace types: array<line>
  Parameters:
    arr (array<line>): line array
  Returns: void

method popr(arr)
  remove and delete last label object from array
  Namespace types: array<label>
  Parameters:
    arr (array<label>): label array
  Returns: void

method popr(arr)
  remove and delete last box object from array
  Namespace types: array<box>
  Parameters:
    arr (array<box>): box array
  Returns: void

method popr(arr)
  remove and delete last table object from array
  Namespace types: array<table>
  Parameters:
    arr (array<table>): table array
  Returns: void

method popr(arr)
  remove and delete last linefill object from array
  Namespace types: array<linefill>
  Parameters:
    arr (array<linefill>): linefill array
  Returns: void

method popr(arr)
  remove and delete last polyline object from array
  Namespace types: array<polyline>
  Parameters:
    arr (array<polyline>): polyline array
  Returns: void

method shiftr(arr)
  remove first int object from array
  Namespace types: array<int>
  Parameters:
    arr (array<int>): int array
  Returns: int

method shiftr(arr)
  remove first float object from array
  Namespace types: array<float>
  Parameters:
    arr (array<float>): float array
  Returns: float

method shiftr(arr)
  remove first bool object from array
  Namespace types: array<bool>
  Parameters:
    arr (array<bool>): bool array
  Returns: bool

method shiftr(arr)
  remove first string object from array
  Namespace types: array<string>
  Parameters:
    arr (array<string>): string array
  Returns: string

method shiftr(arr)
  remove first color object from array
  Namespace types: array<color>
  Parameters:
    arr (array<color>): color array
  Returns: color

method shiftr(arr)
  remove first chart.point object from array
  Namespace types: array<chart.point>
  Parameters:
    arr (array<chart.point>): chart.point array
  Returns: void

method shiftr(arr)
  remove and delete first line object from array
  Namespace types: array<line>
  Parameters:
    arr (array<line>): line array
  Returns: void

method shiftr(arr)
  remove and delete first label object from array
  Namespace types: array<label>
  Parameters:
    arr (array<label>): label array
  Returns: void

method shiftr(arr)
  remove and delete first box object from array
  Namespace types: array<box>
  Parameters:
    arr (array<box>): box array
  Returns: void

method shiftr(arr)
  remove and delete first table object from array
  Namespace types: array<table>
  Parameters:
    arr (array<table>): table array
  Returns: void

method shiftr(arr)
  remove and delete first linefill object from array
  Namespace types: array<linefill>
  Parameters:
    arr (array<linefill>): linefill array
  Returns: void

method shiftr(arr)
  remove and delete first polyline object from array
  Namespace types: array<polyline>
  Parameters:
    arr (array<polyline>): polyline array
  Returns: void

method push(arr, val, maxItems)
  add int to the end of an array with max items cap. Objects are removed from start to maintain max items cap
  Namespace types: array<int>
  Parameters:
    arr (array<int>): int array
    val (int): int object to be pushed
    maxItems (int): max number of items array can hold
  Returns: int[]

method push(arr, val, maxItems)
  add float to the end of an array with max items cap. Objects are removed from start to maintain max items cap
  Namespace types: array<float>
  Parameters:
    arr (array<float>): float array
    val (float): float object to be pushed
    maxItems (int): max number of items array can hold
  Returns: float[]

method push(arr, val, maxItems)
  add bool to the end of an array with max items cap. Objects are removed from start to maintain max items cap
  Namespace types: array<bool>
  Parameters:
    arr (array<bool>): bool array
    val (bool): bool object to be pushed
    maxItems (int): max number of items array can hold
  Returns: bool[]

method push(arr, val, maxItems)
  add string to the end of an array with max items cap. Objects are removed from start to maintain max items cap
  Namespace types: array<string>
  Parameters:
    arr (array<string>): string array
    val (string): string object to be pushed
    maxItems (int): max number of items array can hold
  Returns: string[]

method push(arr, val, maxItems)
  add color to the end of an array with max items cap. Objects are removed from start to maintain max items cap
  Namespace types: array<color>
  Parameters:
    arr (array<color>): color array
    val (color): color object to be pushed
    maxItems (int): max number of items array can hold
  Returns: color[]

method push(arr, val, maxItems)
  add chart.point to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
  Namespace types: array<chart.point>
  Parameters:
    arr (array<chart.point>): chart.point array
    val (chart.point): chart.point object to be pushed
    maxItems (int): max number of items array can hold
  Returns: chart.point[]

method push(arr, val, maxItems)
  add line to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
  Namespace types: array<line>
  Parameters:
    arr (array<line>): line array
    val (line): line object to be pushed
    maxItems (int): max number of items array can hold
  Returns: line[]

method push(arr, val, maxItems)
  add label to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
  Namespace types: array<label>
  Parameters:
    arr (array<label>): label array
    val (label): label object to be pushed
    maxItems (int): max number of items array can hold
  Returns: label[]

method push(arr, val, maxItems)
  add box to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
  Namespace types: array<box>
  Parameters:
    arr (array<box>): box array
    val (box): box object to be pushed
    maxItems (int): max number of items array can hold
  Returns: box[]

method push(arr, val, maxItems)
  add table to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
  Namespace types: array<table>
  Parameters:
    arr (array<table>): table array
    val (table): table object to be pushed
    maxItems (int): max number of items array can hold
  Returns: table[]

method push(arr, val, maxItems)
  add linefill to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
  Namespace types: array<linefill>
  Parameters:
    arr (array<linefill>): linefill array
    val (linefill): linefill object to be pushed
    maxItems (int): max number of items array can hold
  Returns: linefill[]

method push(arr, val, maxItems)
  add polyline to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
  Namespace types: array<polyline>
  Parameters:
    arr (array<polyline>): polyline array
    val (polyline): polyline object to be pushed
    maxItems (int): max number of items array can hold
  Returns: polyline[]

method unshift(arr, val, maxItems)
  add int to the beginning of an array with max items cap. Objects are removed from end to maintain max items cap
  Namespace types: array<int>
  Parameters:
    arr (array<int>): int array
    val (int): int object to be unshift
    maxItems (int): max number of items array can hold
  Returns: int[]

method unshift(arr, val, maxItems)
  add float to the beginning of an array with max items cap. Objects are removed from end to maintain max items cap
  Namespace types: array<float>
  Parameters:
    arr (array<float>): float array
    val (float): float object to be unshift
    maxItems (int): max number of items array can hold
  Returns: float[]

method unshift(arr, val, maxItems)
  add bool to the beginning of an array with max items cap. Objects are removed from end to maintain max items cap
  Namespace types: array<bool>
  Parameters:
    arr (array<bool>): bool array
    val (bool): bool object to be unshift
    maxItems (int): max number of items array can hold
  Returns: bool[]

method unshift(arr, val, maxItems)
  add string to the beginning of an array with max items cap. Objects are removed from end to maintain max items cap
  Namespace types: array<string>
  Parameters:
    arr (array<string>): string array
    val (string): string object to be unshift
    maxItems (int): max number of items array can hold
  Returns: string[]

method unshift(arr, val, maxItems)
  add color to the beginning of an array with max items cap. Objects are removed from end to maintain max items cap
  Namespace types: array<color>
  Parameters:
    arr (array<color>): color array
    val (color): color object to be unshift
    maxItems (int): max number of items array can hold
  Returns: color[]

method unshift(arr, val, maxItems)
  add chart.point to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
  Namespace types: array<chart.point>
  Parameters:
    arr (array<chart.point>): chart.point array
    val (chart.point): chart.point object to be unshift
    maxItems (int): max number of items array can hold
  Returns: chart.point[]

method unshift(arr, val, maxItems)
  add line to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
  Namespace types: array<line>
  Parameters:
    arr (array<line>): line array
    val (line): line object to be unshift
    maxItems (int): max number of items array can hold
  Returns: line[]

method unshift(arr, val, maxItems)
  add label to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
  Namespace types: array<label>
  Parameters:
    arr (array<label>): label array
    val (label): label object to be unshift
    maxItems (int): max number of items array can hold
  Returns: label[]

method unshift(arr, val, maxItems)
  add box to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
  Namespace types: array<box>
  Parameters:
    arr (array<box>): box array
    val (box): box object to be unshift
    maxItems (int): max number of items array can hold
  Returns: box[]

method unshift(arr, val, maxItems)
  add table to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
  Namespace types: array<table>
  Parameters:
    arr (array<table>): table array
    val (table): table object to be unshift
    maxItems (int): max number of items array can hold
  Returns: table[]

method unshift(arr, val, maxItems)
  add linefill to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
  Namespace types: array<linefill>
  Parameters:
    arr (array<linefill>): linefill array
    val (linefill): linefill object to be unshift
    maxItems (int): max number of items array can hold
  Returns: linefill[]

method unshift(arr, val, maxItems)
  add polyline to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
  Namespace types: array<polyline>
  Parameters:
    arr (array<polyline>): polyline array
    val (polyline): polyline object to be unshift
    maxItems (int): max number of items array can hold
  Returns: polyline[]

method isEmpty(arr)
  checks if an int array is either null or empty
  Namespace types: array<int>
  Parameters:
    arr (array<int>): int array
  Returns: bool

method isEmpty(arr)
  checks if a float array is either null or empty
  Namespace types: array<float>
  Parameters:
    arr (array<float>): float array
  Returns: bool

method isEmpty(arr)
  checks if a string array is either null or empty
  Namespace types: array<string>
  Parameters:
    arr (array<string>): string array
  Returns: bool

method isEmpty(arr)
  checks if a bool array is either null or empty
  Namespace types: array<bool>
  Parameters:
    arr (array<bool>): bool array
  Returns: bool

method isEmpty(arr)
  checks if a color array is either null or empty
  Namespace types: array<color>
  Parameters:
    arr (array<color>): color array
  Returns: bool

method isEmpty(arr)
  checks if a chart.point array is either null or empty
  Namespace types: array<chart.point>
  Parameters:
    arr (array<chart.point>): chart.point array
  Returns: bool

method isEmpty(arr)
  checks if a line array is either null or empty
  Namespace types: array<line>
  Parameters:
    arr (array<line>): line array
  Returns: bool

method isEmpty(arr)
  checks if a label array is either null or empty
  Namespace types: array<label>
  Parameters:
    arr (array<label>): label array
  Returns: bool

method isEmpty(arr)
  checks if a box array is either null or empty
  Namespace types: array<box>
  Parameters:
    arr (array<box>): box array
  Returns: bool

method isEmpty(arr)
  checks if a linefill array is either null or empty
  Namespace types: array<linefill>
  Parameters:
    arr (array<linefill>): linefill array
  Returns: bool

method isEmpty(arr)
  checks if a polyline array is either null or empty
  Namespace types: array<polyline>
  Parameters:
    arr (array<polyline>): polyline array
  Returns: bool

method isEmpty(arr)
  checks if a table array is either null or empty
  Namespace types: array<table>
  Parameters:
    arr (array<table>): table array
  Returns: bool

method isNotEmpty(arr)
  checks if an int array is not null and has at least one item
  Namespace types: array<int>
  Parameters:
    arr (array<int>): int array
  Returns: bool

method isNotEmpty(arr)
  checks if a float array is not null and has at least one item
  Namespace types: array<float>
  Parameters:
    arr (array<float>): float array
  Returns: bool

method isNotEmpty(arr)
  checks if a string array is not null and has at least one item
  Namespace types: array<string>
  Parameters:
    arr (array<string>): string array
  Returns: bool

method isNotEmpty(arr)
  checks if a bool array is not null and has at least one item
  Namespace types: array<bool>
  Parameters:
    arr (array<bool>): bool array
  Returns: bool

method isNotEmpty(arr)
  checks if a color array is not null and has at least one item
  Namespace types: array<color>
  Parameters:
    arr (array<color>): color array
  Returns: bool

method isNotEmpty(arr)
  checks if a chart.point array is not null and has at least one item
  Namespace types: array<chart.point>
  Parameters:
    arr (array<chart.point>): chart.point array
  Returns: bool

method isNotEmpty(arr)
  checks if a line array is not null and has at least one item
  Namespace types: array<line>
  Parameters:
    arr (array<line>): line array
  Returns: bool

method isNotEmpty(arr)
  checks if a label array is not null and has at least one item
  Namespace types: array<label>
  Parameters:
    arr (array<label>): label array
  Returns: bool

method isNotEmpty(arr)
  checks if a box array is not null and has at least one item
  Namespace types: array<box>
  Parameters:
    arr (array<box>): box array
  Returns: bool

method isNotEmpty(arr)
  checks if a linefill array is not null and has at least one item
  Namespace types: array<linefill>
  Parameters:
    arr (array<linefill>): linefill array
  Returns: bool

method isNotEmpty(arr)
  checks if a polyline array is not null and has at least one item
  Namespace types: array<polyline>
  Parameters:
    arr (array<polyline>): polyline array
  Returns: bool

method isNotEmpty(arr)
  checks if a table array is not null and has at least one item
  Namespace types: array<table>
  Parameters:
    arr (array<table>): table array
  Returns: bool

method flush(arr)
  remove all int objects in an array
  Namespace types: array<int>
  Parameters:
    arr (array<int>): int array
  Returns: int[]

method flush(arr)
  remove all float objects in an array
  Namespace types: array<float>
  Parameters:
    arr (array<float>): float array
  Returns: float[]

method flush(arr)
  remove all bool objects in an array
  Namespace types: array<bool>
  Parameters:
    arr (array<bool>): bool array
  Returns: bool[]

method flush(arr)
  remove all string objects in an array
  Namespace types: array<string>
  Parameters:
    arr (array<string>): string array
  Returns: string[]

method flush(arr)
  remove all color objects in an array
  Namespace types: array<color>
  Parameters:
    arr (array<color>): color array
  Returns: color[]

method flush(arr)
  remove all chart.point objects in an array
  Namespace types: array<chart.point>
  Parameters:
    arr (array<chart.point>): chart.point array
  Returns: chart.point[]

method flush(arr)
  remove and delete all line objects in an array
  Namespace types: array<line>
  Parameters:
    arr (array<line>): line array
  Returns: line[]

method flush(arr)
  remove and delete all label objects in an array
  Namespace types: array<label>
  Parameters:
    arr (array<label>): label array
  Returns: label[]

method flush(arr)
  remove and delete all box objects in an array
  Namespace types: array<box>
  Parameters:
    arr (array<box>): box array
  Returns: box[]

method flush(arr)
  remove and delete all table objects in an array
  Namespace types: array<table>
  Parameters:
    arr (array<table>): table array
  Returns: table[]

method flush(arr)
  remove and delete all linefill objects in an array
  Namespace types: array<linefill>
  Parameters:
    arr (array<linefill>): linefill array
  Returns: linefill[]

method flush(arr)
  remove and delete all polyline objects in an array
  Namespace types: array<polyline>
  Parameters:
    arr (array<polyline>): polyline array
  Returns: polyline[]

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน