Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dim Arrays at run-time

Status
Not open for further replies.

bms1

Programmer
Dec 26, 2002
8
US
Is it possible to set the size of an array at run time in clarion? Any help would be greatly appreated.

 
Hi,

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.

Hope this will help you.

Valery.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top