PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Some bug

The bug(?!) :
Code:

#define TlistInf {"f1","f2"}

#class Ttest
public(
l$,
st$
);
public nproc Create
list(l$);
add(l$);
struct(l$, TlistInf);
l.f1$ = 10;
l.f2$ = 400;
struct(st$, TlistInf);
st.f1$ = 20;
st.f2$ = 800;
end;
#endclass


Proc main
#object Ttest obj$
a$ = obj.l.f1$;
b$ = obj.st.f1$;
showMessage(str(a$));
showMessage(str(b$));
end;


Btw,
How to count elements of array which is element of the list:
Code:

list(l$);
add(l$);
dim(l$,10);

count(l$) - returns the number of list elements, whereas I need the number of array elements of current list elem.
The bug has been fixed. It just happened that structure element variables weren't made public. Thanks for pointing it out.

The answer to the second question is:

vmax(l$) will return the number of elements in the array l$.