From 2f02189ddcdeb7d25b0ca9bd5b955b764d41a1a7 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 21 May 2016 17:44:53 -0700 Subject: 2996 --- html/081print.mu.html | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'html/081print.mu.html') diff --git a/html/081print.mu.html b/html/081print.mu.html index 1c998733..286e801d 100644 --- a/html/081print.mu.html +++ b/html/081print.mu.html @@ -403,6 +403,26 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color clear-line-on-display ] +def clear-line-until screen:address:screen, right:number/inclusive -> screen:address:screen [ + local-scope + load-ingredients + _, column:number <- cursor-position screen + space:character <- copy 32/space + bg-color:number, bg-color-found?:boolean <- next-ingredient + { + # default bg-color to black + break-if bg-color-found? + bg-color <- copy 0/black + } + { + done?:boolean <- greater-than column, right + break-if done? + screen <- print screen, space, 7/white, bg-color # foreground color is mostly unused except if the cursor shows up at this cell + column <- add column, 1 + loop + } +] + def cursor-position screen:address:screen -> row:number, column:number [ local-scope load-ingredients @@ -560,6 +580,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color screen <- cursor-to-start-of-line screen ] +def move-cursor-to-column screen:address:screen, column:number -> screen:address:screen [ + local-scope + load-ingredients + row:number, _ <- cursor-position screen + move-cursor screen, row, column +] + def screen-width screen:address:screen -> width:number [ local-scope load-ingredients -- cgit 1.4.1-2-gfad0