Hello All,
I have some array and I want to know the number of items in each array.
array1, array2....array20
If I use the code below:
let>k=0
Repeat>k
Add>k,1
ArrayCount>array%k%,itemCount
mdl>itemCount
Until>k=20
The program is crashed.
Please help!
ArrayCount
Moderators: Dorian (MJT support), JRL
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: ArrayCount
If I run your code without any arrays, I just get MDL returning zero 20 times.
However, if I use ArrayDim to create 20 arrays, mine hangs on ArrayCount too. In fact it hangs even if I simply create 1 array, and use ArrayCount in conjunction with a variable.
This hangs :
This doesn't
I haven't managed to figure out why yet. I will consult Marcus.
In the meantime, for anyone watching, this is the code I used to test :
However, if I use ArrayDim to create 20 arrays, mine hangs on ArrayCount too. In fact it hangs even if I simply create 1 array, and use ArrayCount in conjunction with a variable.
This hangs :
Code: Select all
ArrayCount>Array%k%,itemCount
Code: Select all
ArrayCount>Array1,itemCount
In the meantime, for anyone watching, this is the code I used to test :
Code: Select all
//Create the arrays
let>z=0
Repeat>z
Add>z,1
ArrayDim>array%z%,3
Let>array%z%_1=Fred
Let>array%z%_2=Sally
Let>array%z%_3=John
Until>z=5
let>k=0
Repeat>k
Add>k,1
//Warning - hangs
//ArrayCount>Array%k%,itemCount
ArrayCount>Array1,itemCount
mdl>itemCount
Until>k=5
Yes, we have a Custom Scripting Service. Message me or go here
Re: ArrayCount
Yes, I have done the test as you did.
ArrayCount>array1, count: works but ArrayCount>array%k% will cause the program runs forever...
ArrayCount>array1, count: works but ArrayCount>array%k% will cause the program runs forever...
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: ArrayCount
I have made Marcus aware of our findings and of this thread, and we'll see what he comes up with.
Yes, we have a Custom Scripting Service. Message me or go here