Re: 1 little sequence problem
- Posted by Matthew Lewis <MatthewL at KAPCOUSA.COM> Mar 17, 2000
- 410 views
>From: =A9koda >sequence s1 >for i=3D1 to 10 do > s1[i]=3Di >end for >i get error message: variable s1 has not been assigned a value=20 Sequences are dynamic, but you can't subscript something that's not = already there. There are a couple of things you can do: s1 =3D repeat(0, 10) for i=3D1 to 10 do s1[i]=3Di end for -- This is probably the fastest (see performance tips in the Eu docs) s1 =3D { 0,0,0,0,0,0,0,0,0,0} for i=3D1 to 10 do s1[i]=3Di end for or: sequence s1 s1 =3D {} for i=3D1 to 10 do s1 &=3D i end for Matt