Terminal control/Cursor positioning: Difference between revisions

m
Moved Wren entry into correct alphabetical order.
(Terminal control/Cursor positioning en FreeBASIC)
m (Moved Wren entry into correct alphabetical order.)
 
(17 intermediate revisions by 9 users not shown)
Line 8:
=={{header|AArch64 Assembly}}==
{{works with|as|Raspberry Pi 3B version Buster 64 bits}}
<syntaxhighlight lang="aarch64 assembly">
<lang AArch64 Assembly>
/* ARM assembly AARCH64 Raspberry PI 3B */
/* program cursorPos64.s */
Line 64:
/* for this file see task include a file in language AArch64 assembly */
.include "../includeARM64.inc"
</syntaxhighlight>
</lang>
=={{header|Action!}}==
<syntaxhighlight lang="action!">PROC Main()
Position(3,6)
Print("Hello")
RETURN</syntaxhighlight>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Cursor_positioning.png Screenshot from Atari 8-bit computer]
 
=={{header|Ada}}==
 
<langsyntaxhighlight Adalang="ada">with Ada.Text_IO;
 
procedure Cursor_Pos is
Line 75 ⟶ 83:
Ada.Text_IO.Set_Col(3);
Ada.Text_IO.Put("Hello");
end Cursor_Pos;</langsyntaxhighlight>
 
=={{header|ARM Assembly}}==
{{works with|as|Raspberry Pi}}
<syntaxhighlight lang="arm assembly">
<lang ARM Assembly>
 
/* ARM assembly Raspberry PI */
Line 147 ⟶ 155:
bx lr @ return
 
</syntaxhighlight>
</lang>
 
=={{header|Arturo}}==
 
<langsyntaxhighlight lang="rebol">goto 3 6
print "Hello"</langsyntaxhighlight>
 
=={{header|AutoHotkey}}==
{{works with|AutoHotkey_L}}
Remember that AHK is not built for the console, so we must call the WinAPI directly.
<langsyntaxhighlight AHKlang="ahk">DllCall( "AllocConsole" ) ; create a console if not launched from one
hConsole := DllCall( "GetStdHandle", int, STDOUT := -11 )
 
Line 171 ⟶ 179:
return out
return 0
}</langsyntaxhighlight>
 
=={{header|Axe}}==
Since the rows and columns are zero-indexed, we must subtract 1 from both.
<langsyntaxhighlight lang="axe">Output(2,5,"HELLO")</langsyntaxhighlight>
 
=={{header|BaConBASIC}}==
==={{header|Applesoft BASIC}}===
<lang freebasic>' Cursor positioning, requires ANSI compliant terminal
<syntaxhighlight lang="applesoft basic"> 10 VTAB 6: HTAB 3
20 PRINT "HELLO"</syntaxhighlight>
 
==={{header|ASIC}}===
Rows have the range 0-24, columns have the range 0-79.
<syntaxhighlight lang="basic">
LOCATE 5, 2
PRINT "Hello"
</syntaxhighlight>
 
==={{header|BaCon}}===
<syntaxhighlight lang="freebasic">' Cursor positioning, requires ANSI compliant terminal
GOTOXY 3,6
PRINT "Hello"</langsyntaxhighlight>
The X Y in <code>GOTOXY</code> is Column Row order.
 
==={{header|BBC BASIC}}===
<syntaxhighlight lang="bbcbasic">PRINT TAB(2,5);"Hello"</syntaxhighlight>
 
==={{header|ApplesoftCommodore BASIC}}===
{{works with|Commodore BASIC|3.5}}
<lang Applesoft BASIC> 10 VTAB 6: HTAB 3
<syntaxhighlight lang="basic">
20 PRINT "HELLO"</lang>
10 CHAR ,2,5,"HELLO"
</syntaxhighlight>
 
{{works with|Commodore BASIC|2.0}}
<syntaxhighlight lang="basic"> 100 print chr$(19) :rem change to lowercase set
110 print chr$(14) :rem go to position 1,1
120 print:print:print:print
130 print tab(2) "Hello" </syntaxhighlight>
 
==={{header|FreeBASIC}}===
<syntaxhighlight lang="freebasic">Locate 6, 3 : Print "Hello"
Sleep</syntaxhighlight>
 
==={{header|GW-BASIC}}===
{{works with|BASICA}}
<syntaxhighlight lang="gwbasic">
10 LOCATE 6, 3
20 PRINT "Hello"
</syntaxhighlight>
 
==={{header|IS-BASIC}}===
<langsyntaxhighlight ISlang="is-BASICbasic">100 PRINT AT 6,3:"Hello"</langsyntaxhighlight>
 
==={{header|Liberty BASIC}}===
<syntaxhighlight lang="lb">locate 3, 6
print "Hello"
</syntaxhighlight>
 
==={{header|Locomotive Basic}}===
<langsyntaxhighlight lang="locobasic"> 10 LOCATE 3,6
20 PRINT "Hello"</langsyntaxhighlight>
 
==={{header|ZX SpectrumMSX Basic}}===
<syntaxhighlight lang="basic"> 10 LOCATE 2,5
<lang zxbasic> 10 REM The top left corner is at position 0,0
20 PRINT "Hello"</syntaxhighlight>
20 REM So we subtract one from the coordinates
30 PRINT AT 5,2 "Hello"</lang>
 
==={{header|BBCNascom BASIC}}===
Line 16 is at the top of the screen and is not scrolled. Line 1 is the next line down, and line 15 is at the bottom.
<lang bbcbasic>PRINT TAB(2,5);"Hello"</lang>
{{works with|Nascom ROM BASIC|4.7}}
<syntaxhighlight lang="basic">
10 SCREEN 3,5:PRINT "Hello"
</syntaxhighlight>
 
==={{header|Commodore BASICNS-HUBASIC}}===
<syntaxhighlight lang="basic">10 LOCATE 3,6
<lang basic> 100 print chr$(19) :rem change to lowercase set
20 PRINT "HELLO"</syntaxhighlight>
110 print chr$(14) :rem go to position 1,1
 
120 print:print:print:print
==={{header|PureBasic}}===
130 print tab(2) "Hello" </lang>
<syntaxhighlight lang="purebasic">EnableGraphicalConsole(#True)
ConsoleLocate(3,6)
Print("Hello")</syntaxhighlight>
 
==={{header|QuickBASIC}}===
{{works with|QBasic}}
{{works with|RapidQ}}
<syntaxhighlight lang="qbasic">
LOCATE 6, 3
PRINT "Hello"
</syntaxhighlight>
 
==={{header|RapidQ}}===
See [[#QuickBASIC|QuickBASIC]].
 
==={{header|ZX Spectrum Basic}}===
<syntaxhighlight lang="zxbasic"> 10 REM The top left corner is at position 0,0
20 REM So we subtract one from the coordinates
30 PRINT AT 5,2 "Hello"</syntaxhighlight>
 
=={{header|Befunge}}==
Assuming a terminal with support for ANSI escape sequences.
<langsyntaxhighlight lang="befunge">0"olleHH3;6["39*>:#,_$@</langsyntaxhighlight>
 
=={{header|Blast}}==
<langsyntaxhighlight lang="blast"># This will display a message at a specific position on the terminal screen
.begin
cursor 6,3
display "Hello!"
return
# This is the end of the script</langsyntaxhighlight>
 
=={{header|C}}/{{header|C++}}==
Using ANSI escape sequence, where ESC[y;xH moves curser to row y, col x:<langsyntaxhighlight lang="c">#include <stdio.h>
int main()
{
printf("\033[6;3HHello\n");
return 0;
}</langsyntaxhighlight>
 
The C version of the minesweeper game uses curses.
Line 234 ⟶ 301:
 
On Windows, using console API:
<langsyntaxhighlight lang="c">#include <windows.h>
 
int main() {
Line 242 ⟶ 309:
WriteConsole(hConsole, "Hello", 5, NULL, NULL);
return 0;
}</langsyntaxhighlight>
 
=={{header|C sharp|C#}}==
{{works with|Mono|1.2}}
{{works with|Visual C sharp|Visual C#|2003}}
<langsyntaxhighlight lang="csharp">static void Main(string[] args)
{
Console.SetCursorPosition(3, 6);
Console.Write("Hello");
}</langsyntaxhighlight>
 
=={{header|COBOL}}==
<langsyntaxhighlight lang="cobol"> IDENTIFICATION DIVISION.
PROGRAM-ID. cursor-positioning.
 
Line 261 ⟶ 328:
 
GOBACK
.</langsyntaxhighlight>
 
=={{header|Common Lisp}}==
==={{header|ncurses}}===
To interface the ncurses C library from Lisp, the ''croatoan'' library is used.
<langsyntaxhighlight lang="lisp">(defun cursor-positioning ()
(with-screen (scr :input-blocking t :input-echoing nil :cursor-visible nil)
(move scr 5 2)
Line 272 ⟶ 339:
(refresh scr)
;; wait for keypress
(get-char scr)))</langsyntaxhighlight>
 
=={{header|D}}==
Line 283 ⟶ 350:
puts the cursor at line L and column C.
 
<syntaxhighlight lang="d">
<lang D>
import std.stdio;
 
Line 290 ⟶ 357:
writef("\033[6;3fHello");
}
</syntaxhighlight>
</lang>
 
'''Output:'''
Line 306 ⟶ 373:
=={{header|Elena}}==
ELENA 4.x :
<langsyntaxhighlight lang="elena">public program()
{
console.setCursorPosition(3,6).write("Hello")
}</langsyntaxhighlight>
 
=={{header|Euphoria}}==
<langsyntaxhighlight Euphorialang="euphoria">position(6,3)
puts(1,"Hello")</langsyntaxhighlight>
 
=={{header|F_Sharp|F#}}==
<langsyntaxhighlight lang="fsharp">open System
 
Console.SetCursorPosition(3, 6)
Console.Write("Hello")</langsyntaxhighlight>
 
=={{header|Forth}}==
<langsyntaxhighlight lang="forth">2 5 at-xy ." Hello"</langsyntaxhighlight>
 
=={{header|Fortran}}==
===Intel Fortran on Windows===
<langsyntaxhighlight lang="fortran">program textposition
use kernel32
implicit none
Line 335 ⟶ 402:
q = SetConsoleCursorPosition(hConsole, T_COORD(3, 6))
q = WriteConsole(hConsole, loc("Hello"), 5, NULL, NULL)
end program</langsyntaxhighlight>
 
 
=={{header|FreeBASIC}}==
<lang freebasic>Locate 6, 3 : Print "Hello"
Sleep</lang>
 
 
=={{header|Go}}==
===External command===
<langsyntaxhighlight lang="go">package main
 
import (
Line 360 ⟶ 421:
cmd.Run()
fmt.Println("Hello")
}</langsyntaxhighlight>
===ANSI escape codes===
<langsyntaxhighlight lang="go">package main
 
import "fmt"
Line 368 ⟶ 429:
func main() {
fmt.Println("\033[2J\033[6;3HHello")
}</langsyntaxhighlight>
===Ncurses===
{{libheader|curses}}
<langsyntaxhighlight lang="go">package main
 
import (
Line 388 ⟶ 449:
s.Println("Hello")
s.GetChar()
}</langsyntaxhighlight>
 
=={{header|Icon}} and {{header|Unicon}}==
If the OS has older termcap files, CUP is included with <tt>link ansi</tt>
<langsyntaxhighlight lang="unicon">procedure main()
writes(CUP(6,3), "Hello")
end
Line 399 ⟶ 460:
writes("\^[[",i,";",j,"H")
return
end</langsyntaxhighlight>
 
=={{header|J}}==
Using terminal positioning verbs of [[Terminal_control/Coloured_text#J]]
<syntaxhighlight lang J="j">'Hello',~move 6 3</langsyntaxhighlight>
 
=={{header|jq}}==
{{works with|jq}}
''Also works with gojq and jaq.
<syntaxhighlight lang="bash">
jq -nr '"\u001b[2J", # clear the terminal
"\u001b[6;3HHello" # move to (6,3) and print Hello
'
</syntaxhighlight>
 
=={{header|Julia}}==
<langsyntaxhighlight lang="julia">const ESC = "\u001B"
 
gotoANSI(x, y) = print("$ESC[$(y);$(x)H")
Line 412 ⟶ 482:
gotoANSI(3, 6)
println("Hello")
</syntaxhighlight>
</lang>
 
=={{header|Kotlin}}==
{{Works with|Ubuntu|14.04}}
<langsyntaxhighlight lang="scala">// version 1.1.2
 
fun main(args: Array<String>) {
print("\u001Bc") // clear screen first
println("\u001B[6;3HHello")
}</langsyntaxhighlight>
 
=={{header|Lasso}}==
<langsyntaxhighlight Lassolang="lasso">local(esc = decode_base64('Gw=='))
 
stdout( #esc + '[6;3HHello')</langsyntaxhighlight>
 
=={{header|Liberty BASIC}}==
<lang lb>locate 3, 6
print "Hello"
</lang>
 
=={{header|Logo}}==
<langsyntaxhighlight lang="logo">setcursor [2 5]
type "Hello</langsyntaxhighlight>
You can also draw positioned text on the turtle graphics window.
<langsyntaxhighlight lang="logo">setpos [20 50]
setxy 20 30 ; alternate way to set position
label "Hello</langsyntaxhighlight>
=={{header|M2000 Interpreter}}==
M2000 has own console from M2000 Environment. Here we use a windows console, using Win32 Api.
[[File:Consol63.png|thumb|alt=Console Example]]
 
 
=={{header|Mathematica}}==
 
<lang Mathematica>Run["tput cup 6 3"]
 
Print["Hello"]</lang>
 
 
 
 
 
 
 
 
<syntaxhighlight lang="m2000 interpreter">
Module Fix_Console_Window {
// This Module:
// a) move console window
// b) disable console close window. Without it, a close console terminates the M2000 environment
declare GetConsoleWindow Lib "Kernel32.GetConsoleWindow"
declare SetWindowPos Lib "User32.SetWindowPos" {Long hwnd, Long hWnd, Long x, Long y , Long nWidth, Long nHeight, Long uFlags}
declare GetSystemMenu Lib "User32.GetSystemMenu" {Long hWnd, Long bRevert}
const SC_CLOSE = 0xF060
const MF_BYCOMMAND = 0
declare DeleteMenu Lib "User32.DeleteMenu" {Long hMenu, Long uPosition, Long uFlags}
call Void DeleteMenu(GetSystemMenu(GetConsoleWindow(), 0), SC_CLOSE, MF_BYCOMMAND)
// if we dont move the M2000 console window (which is full screen),
// we can get the position and dimension of the current monitor
// current monitor return the read only variable Window
back {
gradient 0 ' set black preserving cursors
x=motion.x div twipsx ' make x,y,w, h PIXELS
y=motion.y div twipsy
w=scale.x div twipsx
h=scale.y div twipsy
}
// set console window 50px smaller form all sides from full screen
call void SetWindowPos(GetConsoleWindow(), -1, x+50, y+50, w-100, h-100, 0x0040)
}
declare SetCosnoleDispMode lib "Kernel32.SetConsoleDisplayMode" { Long cons, Long b, Long &opt}
declare GetMode lib "Kernel32.GetConsoleMode" {Long cons, long &a}
declare SetMode lib "kernel32.SetConsoleMode" {Long cons, long a}
declare GetConsole lib "Kernel32.AllocConsole"
declare FreeConsole lib "Kernel32.FreeConsole"
declare ConsoleCaption lib "Kernel32.SetConsoleTitleW" {a$}
declare GetHandle lib "Kernel32.GetStdHandle" {Long a}
declare CloseHandle lib "Kernel32.CloseHandle" {Long a}
// we use the W version (always M2000 need the W version for strings)
declare global WriteCons Lib "Kernel32.WriteConsoleW" {Long cons, a$, Long n, Long &p, Long u}
const CONSOLE_FULLSCREEN_MODE=1&, CONSOLE_WINDOWED_MODE=0&
const ENABLE_VIRTUAL_TERMINAL_PROCESSING=0x0004
// These are special sequences
const StopBlinking$=chr$(27)+"[?25l"
Def EscXY$(x,y)=chr$(27)+"["+str$(y,0)+";"+str$(x,0)+"H"
 
// Using Windows Console
// void make the call to drop return value, without this the call use non zero values as error number
// using R=GetConsole() we can get the return value.
call void GetConsole()
call void ConsoleCaption("M2000 Windows Console")
// -11 for output
Long m=-11, RetLong
m=GetHandle(m)
Call Fix_Console_Window
// you can skip SetCosnoleDispModet,
// it seems this mode CONSOLE_WINDOWED_MODE is by default.
// call void SetCosnoleDispMode(m, CONSOLE_WINDOWED_MODE, &RetLong) ' 1 for fullscreen
wait 10 ' give 10ms time to OS
// Now we set the Virtual Terminal Processing (so we can send ESC codes)
Call Void GetMode(m, &RetLong)
Call Void SetMode(M,binary.or(Retlong, ENABLE_VIRTUAL_TERMINAL_PROCESSING))
// Stop Blinking and set cursor (we can't see) to 3rd column and 6th row
// window's console origin is at 1,1
PrintConsole(StopBlinking$+EscXY$(3, 6))
// Print RetLong
wait 1000
PrintConsole("Hello")
// Print RetLong
wait 12000
call void CloseHandle(m)
call void FreeConsole()
// Using M2000 console (not the window one)
cls 0, 0
// M2000 layer origin is 0,0
// Cursor 3-1, 6-1 ' statement to set cursor
Print @(3-1, 6-1), "Hello"
 
Sub PrintConsole(a$)
RetLong=0&
call Void WriteCons(m, a$, Len(a$), &RetLong, 0)
End Sub
</syntaxhighlight>
 
=={{header|Mathematica}}/{{header|Wolfram Language}}==
<syntaxhighlight lang="mathematica">Run["tput cup 6 3"]
Print["Hello"]</syntaxhighlight>
 
=={{header|Nim}}==
<langsyntaxhighlight lang="nim">import terminal
setCursorPos(3, 6)
echo "Hello"</langsyntaxhighlight>
 
=={{header|NS-HUBASIC}}==
<lang NS-HUBASIC>10 LOCATE 3,6
20 PRINT "HELLO"</lang>
 
=={{header|OCaml}}==
 
Using the library [http://forge.ocamlcore.org/projects/ansiterminal/ ANSITerminal]:
<syntaxhighlight lang="ocaml">#load "unix.cma"
 
<lang ocaml>#load "unix.cma"
#directory "+ANSITerminal"
#load "ANSITerminal.cma"
Line 468 ⟶ 620:
Trm.set_cursor 3 6;
Trm.print_string [] "Hello";
;;</langsyntaxhighlight>
 
=={{header|Pascal}}==
<syntaxhighlight lang="pascal">
<lang Pascal>
program cursor_pos;
uses crt;
Line 478 ⟶ 630:
write('Hello');
end.
</syntaxhighlight>
</lang>
 
=={{header|Perl}}==
Using the Term::Cap module:
<langsyntaxhighlight lang="perl">
use Term::Cap;
 
Line 488 ⟶ 640:
print $t->Tgoto("cm", 2, 5); # 0-based
print "Hello";
</syntaxhighlight>
</lang>
 
=={{header|Phix}}==
<!--<syntaxhighlight lang="phix">(notonline)-->
<lang Phix>position(6,3)
<span style="color: #008080;">without</span> <span style="color: #008080;">js</span> <span style="color: #000080;font-style:italic;">-- position</span>
puts(1,"Hello")</lang>
<span style="color: #7060A8;">position</span><span style="color: #0000FF;">(</span><span style="color: #000000;">6</span><span style="color: #0000FF;">,</span><span style="color: #000000;">3</span><span style="color: #0000FF;">)</span>
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"Hello"</span><span style="color: #0000FF;">)</span>
<!--</syntaxhighlight>-->
 
=={{header|PHP}}==
<syntaxhighlight lang="php">
<lang PHP>
echo "\033[".$x.",".$y."H"; // Position line $y and column $x.
echo "\033[".$n."A"; // Up $n lines.
Line 502 ⟶ 657:
echo "\033[".$n."D"; // Backward $n columns.
echo "\033[2J"; // Clear the screen, move to (0,0).
</syntaxhighlight>
</lang>
 
=={{header|PicoLisp}}==
<langsyntaxhighlight PicoLisplang="picolisp">(call 'tput "cup" 6 3)
(prin "Hello")</langsyntaxhighlight>
 
=={{header|PowerShell}}==
The following will only work in the PowerShell console host. Most notably it will not work in the PowerShell ISE.
<langsyntaxhighlight lang="powershell">$Host.UI.RawUI.CursorPosition = New-Object System.Management.Automation.Host.Coordinates 2,5
$Host.UI.Write('Hello')</langsyntaxhighlight>
Alternatively, in any PowerShell host that uses the Windows console, one can directly use the .NET <code>Console</code> class:
<langsyntaxhighlight lang="powershell">[Console]::SetCursorPosition(2,5)
[Console]::Write('Hello')</langsyntaxhighlight>
 
=={{header|PureBasic}}==
<lang PureBasic>EnableGraphicalConsole(#True)
ConsoleLocate(3,6)
Print("Hello")</lang>
 
=={{header|Python}}==
Using ANSI escape sequence, where ESC[y;xH moves curser to row y, col x:<langsyntaxhighlight Pythonlang="python">print("\033[6;3HHello")</langsyntaxhighlight>
On Windows it needs to import and init the [http://code.google.com/p/colorama/ colorama] module first.
 
ANSI sequences are not recognized in Windows console, here is a program using Windows API:
 
<langsyntaxhighlight lang="python">from ctypes import *
 
STD_OUTPUT_HANDLE = -11
Line 543 ⟶ 693:
windll.kernel32.WriteConsoleA(h, c_char_p(c), len(c), None, None)
 
print_at(6, 3, "Hello")</langsyntaxhighlight>
 
=={{header|Quackery}}==
 
<langsyntaxhighlight Quackerylang="quackery"> [ number$ swap number$
$ 'print("\033[' rot join
char ; join
Line 554 ⟶ 704:
python ] is cursor-at ( x y --> )
 
3 6 cursor-at say "Hello"</langsyntaxhighlight>
 
=={{header|Racket}}==
<langsyntaxhighlight lang="racket">
#lang racket
(require (planet neil/charterm:3:0))
Line 564 ⟶ 714:
(charterm-cursor 3 6)
(displayln "Hello World"))
</syntaxhighlight>
</lang>
 
=={{header|Raku}}==
(formerly Perl 6)
Assuming an ANSI terminal:
<syntaxhighlight lang="raku" perl6line>print "\e[6;3H";
print 'Hello';</langsyntaxhighlight>
 
=={{header|Retro}}==
<langsyntaxhighlight Retrolang="retro">with console'
: hello 3 6 at-xy "Hello" puts ;</langsyntaxhighlight>
 
=={{header|REXX}}==
Line 580 ⟶ 730:
<br>added the functionality via different methods &nbsp; (such as functions and/or subroutines).
{{works with|PC/REXX, Personal REXX}}
<langsyntaxhighlight lang="rexx">/*REXX program demonstrates moving the cursor position and writing of text to same place*/
 
call cursor 3,6 /*move the cursor to row 3, column 6. */
Line 590 ⟶ 740:
 
call scrwrite 40,60,'Hello.',,,14 /*another method ... in yellow. */
exit 0 /*stick a fork in it, we're all done. */</langsyntaxhighlight>
 
=={{header|Ring}}==
<langsyntaxhighlight lang="ring">
# Project : Terminal control/Cursor positioning
 
Line 600 ⟶ 750:
next
see " Hello"
</syntaxhighlight>
</lang>
Output:
<pre>
Line 613 ⟶ 763:
=={{header|Ruby}}==
{{libheader|curses}}
<langsyntaxhighlight lang="ruby">require 'curses'
 
Curses.init_screen
Line 623 ⟶ 773:
ensure
Curses.close_screen
end</langsyntaxhighlight>
 
=={{header|Scala}}==
{{Works with|Ubuntu|14.04}}
<langsyntaxhighlight lang="scala">object Main extends App {
print("\u001Bc") // clear screen first
println("\u001B[6;3HHello")
}</langsyntaxhighlight>
 
=={{header|Seed7}}==
Line 637 ⟶ 787:
''SetPos'' is based on terminfo respectively the Windows console API.
 
<langsyntaxhighlight lang="seed7">$ include "seed7_05.s7i";
include "console.s7i";
 
Line 651 ⟶ 801:
# the program waits until Return/Enter is pressed.
readln;
end func;</langsyntaxhighlight>
 
=={{header|Tcl}}==
<langsyntaxhighlight lang="tcl">exec tput cup 5 2 >/dev/tty
puts "Hello"</langsyntaxhighlight>
 
=={{header|UNIX Shell}}==
 
<langsyntaxhighlight lang="sh"># The tput utility numbers from zero, so we have subtracted 1 from row and column
# number to obtain correct positioning.
tput cup 5 2</langsyntaxhighlight>
 
=={{header|Whitespace}}==
Using ANSI escape sequence, where ESC[y;xH moves curser to row y, col x (see below):
<langsyntaxhighlight lang="whitespace">
Line 699 ⟶ 849:
 
</syntaxhighlight>
</lang>
 
This solution was generated from the following pseudo-Assembly.
<langsyntaxhighlight lang="asm">push "Hello" ;The characters are pushed onto the stack in reverse order
push "[6;3H"
push 27 ;ESC
Line 717 ⟶ 867:
 
1:
pop ret ;Pop counter and return</langsyntaxhighlight>
 
=={{header|Wren}}==
<syntaxhighlight lang="wren">System.write("\e[2J") // clear the terminal
System.print("\e[6;3HHello") // move to (6, 3) and print 'Hello'</syntaxhighlight>
 
=={{header|XPL0}}==
<langsyntaxhighlight XPL0lang="xpl0">include c:\cxpl\codes; \intrinsic 'code' declarations
 
[Cursor(2, 5); \3rd column, 6th row
Text(0, "Hello"); \upper-left corner is coordinate 0, 0
]</langsyntaxhighlight>
 
=={{header|WrenZ80 Assembly}}==
Uses Amstrad CPC, but other machines with similar terminal functions can do the job. (The BIOS calls will be different however.)
<lang ecmascript>System.write("\e[2J") // clear the terminal
<syntaxhighlight lang="z80">ld hl,&0603 ;6 = ROW, 3 = COLUMN
System.print("\e[6;3HHello") // move to (6, 3) and print 'Hello'</lang>
call &BB75 ;set text cursor according to HL
 
ld hl,Message
call PrintString
 
ret ;return to basic
 
Message:
byte "Hello",0
 
PrintString:
ld a,(hl) ;read a byte from the string
or a ;check equality to zero
ret z ;if equal to zero, we're done
call &BB5A ;print accumulator as an ascii char to screen
inc hl ;next char
jr PrintString</syntaxhighlight>
 
=={{header|zkl}}==
{{trans|C/C++}}
Using ANSI escape sequence, where ESC[y;xH moves curser to row y, col x:
<langsyntaxhighlight lang="zkl">print("\e[6;3H" "Hello");</langsyntaxhighlight>
 
{{omit from|ACL2}}
9,476

edits