Mike, you da'man!! It runs, it produces the output expected, but it's kinda (understatement of the day) hard to understand... I'm probably not the only one reading that code that is left scratching their heads.... So - let's dissect this a little... Ok, line 50 is the key - the rest is just pretty stuff... 0050 I++; IF N>0 THEN LET T{1:N}=TBL((I|P{1:N})=0,1,IND(1,ERR=*SAME)) First we increment the # we're looking at, I. Fine and dandy. Next, if it's not the first time in the loop we're going to do an assignment. But what are we assigning... Let's look at the TBL() function first cause I always have trouble with this one. From the help file we have this --- PRINT "Expires:",TBL(EXP_DT$="",EXP_DT$,"Never") In this example, if EXP_DT$ is NULL, the logical expression EXP_DT$= will yield 1. A NULL date will print Never. Otherwise, it will yield 0 (zero) and the value of EXP_DT$ will be printed. In effect, this form of the TBL( ) function becomes: TBL( logical_expr, else_value,true_value). --- Ok, so our TBL is going to be returning either a 1 if the expression is false or trying to take a index of an un-opened file - basically forcing the ERR branch to the same line again to increment the number. So now we've got to figure out what exactly the expression is doing... (I|P{1:N})=0 Basically we are checking that the modulus of I and "somenumber" is 0. If that's true, we do the error branch (because if it's 0 that means it's divisible thus not a prime) otherwise we return the 1 - which means we go to the next line. But what is the "somenumber" Let's look at the T{1:N}= To try and understand the P{1:N} bit From some experimentation and recall we're going to be setting each element of T from 1 to N equal to the result of the TBL() function. Why? I'm not sure... Is it to allow the P{1:N} to work in the modulus I wonder... Back to the (I|P{1:N})=0 If I try to print this line on it's own it error 32's so there has to be more too it. I guess for the auto array stuff it needs the auto array stuff on the left side as well... So I test with T{1:N}=P{1:N} And the array's are transfer from one to the other ; each subelement in the new place. This also works for T{5:6}=P{2:3} etc from experimentation - a handy feature to keep in mind.... So now let's try T{1:N}=(((I|P{1:N})=0) And that doesn't error.... But now is it turning the right side of the equation into a format that the left can handle? I wonder if it finds an array on both sides it will repeat each assignment... Let's confirm that theory 1:dim p$[1:c] 1:p$[3]="3" 1:p$[4]="4" 1:p$[5]="5" 1:chris{3:5}=(num(P${3:5})) 1:?chris{all} 0 0 3 4 5 0 0 0 0 0 Yep! By golly it does! That's definitely a cool feature. - Ok. So to summarize all line 50 is doing is a loop for each value already in the P array (so all numbers we've already decided are prime) check to see if it's divisible into the new number. If it is, skip it and go on. A more traditional PVX loop might look like this FOR COUNT = 1 to N IF MOD(I,P[COUNT])=0 CONTINUE ELSE BREAK NEXT COUNT Mike: Did I figure that out right? Thanks for the fun exercise - and the code!! I'll let you know how your code compares with some of the others. Chris Nolan