It is possible to have dynamic arrays in Clarion but there is some limitations. The array can't be a global variable (i.e. : it has to be in a routine or a procedure.) I do it like that :
Method 1 :
I fisrt declare a global variable in my procedure
DimArray Long
Then in a routine :
DynArrayRoutine Routine
Data
DynArray LONG,DIM(DimArray)
Code
Loop i# = 1 To DimArray
DynArray[i#] = i#
message(DynArray[i#])
End
Method 2:
In the global data of the program
DimArray Long
Then in a procedure :
DynArrayPROC PROCEDURE ! DynArray LONG,DIM(DimArray)
CODE
Loop i# = 1 To DimArray
DynArray[i#] = i#
Message(DynArray[i#])
End
The dimention has to be initialised before to call the Routine or the procedure.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.