Move the cursor to a one-based row and column.
Numbers are converted with to_string, never with internal I/O: a
write to an internal unit is not allowed in a pure procedure, and
it would drag in locale-dependent formatting for no gain.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=default_int), | intent(in) | :: | row |
One-based row; values below 1 are clamped to 1. |
||
| integer(kind=default_int), | intent(in) | :: | col |
One-based column; values below 1 are clamped to 1. |
pure function ansi_move_to(row, col) result(seq) !! Move the cursor to a one-based row and column. !! !! Numbers are converted with `to_string`, never with internal I/O: a !! `write` to an internal unit is not allowed in a `pure` procedure, and !! it would drag in locale-dependent formatting for no gain. integer(default_int), intent(in) :: row !! One-based row; values below 1 are clamped to 1. integer(default_int), intent(in) :: col !! One-based column; values below 1 are clamped to 1. character(len=:), allocatable :: seq seq = CSI//to_string(int(max(1_default_int, row), int32))//";"// & to_string(int(max(1_default_int, col), int32))//"H" end function ansi_move_to