class cc
  sys id
  method create(int n=0) as cc *
    cc a at (getmemory n*sizeof cc)
    int i
    for i=1 to n
      a[i].id=i+i
    next
    return @a
  end method
  '
  method show() as string
    return "id: " id
  end method
end class

cc *ob=cc.create(42) 'class factory method called directly without instantiating
print ob[42].show '84