/tutorial/triangle/version4/example1.e
Specman e | 22 lines | 18 code | 3 blank | 1 comment | 0 complexity | 4c597f9ce587e683abc6e798df7ad8cc MD5 | raw file
1class EXAMPLE1 2 -- Using files is really easy too. 3 4create {ANY} 5 main 6 7feature {ANY} 8 main 9 local 10 p1: POINT; file_name: STRING; file: TEXT_FILE_WRITE 11 do 12 create p1.make(1.0, 2.0) 13 p1.translate(1.0, 2.0) 14 p1.display_on(io) 15 file_name := "my_file.txt" 16 create file.connect_to(file_name) 17 p1.display_on(file) 18 file.disconnect 19 io.put_string("And the same output in %"" + file_name + "%" on the disk.%N") 20 end 21 22end -- class EXAMPLE1