Question: How can I check if an assignment has already been made?

How can I check if an assignment already exits?  I have a process that assigns an eqn name to the coefficients of a polynomial.  I have a number of different of polynomials that I want to do this assignment.  I have the following process:


> EqnCoeff := proc (Poly)
local n, k;
global EQN;
n := degree(Poly);
for k from 0 to n do
EQN[k] := coeff(Poly, phi1, k)
end do
end proc;

(my polynomials have indeterminate phi1)

I want to be able to check if EQN[i] already exists and start my counter at the next open value.  For example, I have three polynomials, one is degree 7, the other two are degree 3 each, so I want a total of 16 equations.  The code works fine.  If I execute with the first polynomial, I get 8 equations, EQN[0] through EQN[7].  How can I write code so it checks if EQN[0] exists?  I can figure out the while statement and all that, I just need to know how to check for existence.

Could I assign it to a vector and append a vector?

Thanks,

Ryan
 

Please Wait...