Hello Leonel,

Yes, I pretty much understood your code...

Just a couple of suggestions.

If and then statements...

If a "IF statement has only one statement, you do not need a "endif".


The if statement below NEEDS a endif
Code:
  If a > b then
       c=d
       d=f
       f=g
   endif
this does not need a endif statement;
Code:
  if  a=b then c=d
  ...
  ...
  if d=f then d=g
  ....
This will help you on your code space and readability...(Of course I must look whos speaking too <chuckle> I think my code is some of the hardest to read <g>)

Dwayne