Forum Discussion

m_essaid's avatar
m_essaid
Valued Contributor
10 years ago

delphiScript... dynamic array (or open array)

Hi,

 

I need to declare a dynamic array because i'll know only after its size (it's a ComboBox.wItemCount property that will give me the size).

I can't declare only :

t: array of string;

 

Does anyone could help please ?

  • Here you are:

     

    procedure Test;
    var arr;
    begin
    // ...

    arr := CreateVariantArray(0 {lowest index}, ComboBox.wItemCount-1 {highest index});

    end;
  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    Here you are:

     

    procedure Test;
    var arr;
    begin
    // ...

    arr := CreateVariantArray(0 {lowest index}, ComboBox.wItemCount-1 {highest index});

    end;
  • m_essaid's avatar
    m_essaid
    Valued Contributor

    Hi Helen,

     

    That's great ! ty very much.

    Much more simplier that what i've found using aqString.ListSeparator.

     

    :)