/tutorial/triangle/version4/example1.e
http://github.com/tybor/Liberty · Specman e · 22 lines · 18 code · 3 blank · 1 comment · 0 complexity · 4c597f9ce587e683abc6e798df7ad8cc MD5 · raw file
- class EXAMPLE1
- -- Using files is really easy too.
- create {ANY}
- main
- feature {ANY}
- main
- local
- p1: POINT; file_name: STRING; file: TEXT_FILE_WRITE
- do
- create p1.make(1.0, 2.0)
- p1.translate(1.0, 2.0)
- p1.display_on(io)
- file_name := "my_file.txt"
- create file.connect_to(file_name)
- p1.display_on(file)
- file.disconnect
- io.put_string("And the same output in %"" + file_name + "%" on the disk.%N")
- end
- end -- class EXAMPLE1