// Save Text File Demo // // This macro demonstrate how to use the File.open() and // print() functions to save a sine/cosine table in a text file. // The file is automatically closed using the equivalent // of File.close(f) when the macro exits. Currently only // one file can be open at a time. f = File.open(""); // display file open dialog //f = File.open("/Users/wayne/table.txt"); // use d2s() function (double to string) to specify decimal places for (i=0; i<=2*PI; i+=0.01) print(f, d2s(i,6) + " \t" + d2s(sin(i),6) + " \t" + d2s(cos(i),6));