To write:
To read:
file=writefile("products.dat") for p.product=each product writestring(file,p\name$) writestring(file,p\shop$) writeint(file,p\price) next closefile file
To read:
file=readfile("products.dat") repeat p.product=new product p\name$=readstring(file) p\shop$=readstring(file) p\price=readint(file) until eof closefile file