How to create dynamic arrays

Started by Chris Chancellor, May 02, 2018, 05:48:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Chris Chancellor

Hello Charles

i would like to create a dynamic array rez() with a variable size as below
where ste is a string of variable length


    Long  LengSt = LEN(ste)

    DIM rez( LengSt) AS BYTE


but i  can't compile it as the error is  at the  line
    DIM rez( LengSt) AS BYTE

and that LengSt is a variable


your Oxygen_help.chm states for  creating dynamic arrays as
  dim as long a at getmemory(10*sizeof(long))

but i'm not sure how to do this in my code above


appreciate all your help




  •  

Charles Pegge


O2 standard arrays are static, so you have to create a dynamic array with the redim macro. Then you can resize it, up or down.


Long  LengSt = LEN(ste)

redim byte rez( LengSt)

Chris Chancellor

Thanxx a lot Charles

very compact
  •