Terminal control/Cursor positioning: Difference between revisions

From Rosetta Code
Content added Content deleted
(ZX Spectrum Basic)
(→‎{{header|PureBasic}}: Added PureBasic)
Line 29: Line 29:


=={{header|PureBasic}}==
=={{header|PureBasic}}==
<lang PureBasic>EnableGraphicalConsole(#True)
ConsoleLocate(3,6)
Print("Hello")</lang>


=={{header|Rexx}}==
=={{header|Rexx}}==

Revision as of 19:25, 4 October 2010

{{task}

Move the cursor to column 3, row 6 and display the word "Hello", so that the letter H is in column 3 on row 6.

Ada

Algol68

awk

BASIC

QBasic

Locomotive Basic

10 LOCATE 3,6
20 PRINT "Hello"

ZX Spectrum Basic

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"

Batch File

COBOL

PureBasic

<lang PureBasic>EnableGraphicalConsole(#True) ConsoleLocate(3,6) Print("Hello")</lang>

Rexx

The Rexx programming language does not include terminal control as part of the language. However, it might be possible to output ANSI control sequences, and there are various workarounds which are platform specific:

brexx

regina

The regina interpreter supports the rexxcurses plugin, which provides the facility to set the cursor position:


UNIX Shell