i get a " bad token" error with this , what is the correct way to do it again ?

Code:
for X = 6 to 1                                            
    if index_slot.X >> X = 1  then index_slot = X  '  show the lowest value available  index slot for use 
 next X