

macro UseVectors2d(typ)
{
  type vector {typ x,y}
  macro CopyVectors(a,b,c) {copy @a,@b,c*sizeof(vector)}
  macro ShowVector(a) {a.x + ", " + a.y}
  '
  macro MakeVectorList(pr,v,b,e)
  {
  #ifndef pr
  string pr
  #endif
  scope
  int i
  for i=b to e
    pr+=ShowVector(v[i]) + chr(13) + chr(10)
  next
  end scope
  }
}


UseVectors2d(double)

dim vector v[5]={1,1, 2,4,  3,9,  4,16, 5,32}

CopyVectors v[3],v[4],1

string pr="2D Vector List: "+typeof(v.x)+chr(13)+chr(10)

MakeVectorList pr,v,1,5

print pr
