include std/console.e
include std/graphics.e
clear_screen()
text_color(YELLOW)
display("Hello")
object p1 = get_position()
text_color(BRIGHT_GREEN)
display("World")
object p2 = get_position()
display("Hello starts at line [], column []",p1)
display("World starts at line [], column []",p2)
Results:
Hello starts at line 2, column 1
World starts at line 3, column 1
Problem:
Hello is at top left of screen, i.e. at line 1, column 1, not 2,1
position reports cursor position display() prints a string and moves to the next line, column 1 replace display with puts(1, "hello [etc]") to see the effect no \n in the string to move the cursor to the next line