Terminal control/Cursor positioning: Difference between revisions

From Rosetta Code
Content added Content deleted
(Making draft for now. Having a bunch of empty language entries is bad form on RC, so it can stay draft until that's resolved.)
(Trim everything without a solution)
Line 2: Line 2:


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.
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.

=={{header|Ada}}==

=={{header|Algol68}}==

=={{header|awk}}==


=={{header|BASIC}}==
=={{header|BASIC}}==

=== {{header|QBasic}} ===


=== {{header|Locomotive Basic}} ===
=== {{header|Locomotive Basic}} ===


10 LOCATE 3,6
<lang basic> 10 LOCATE 3,6
20 PRINT "Hello"
20 PRINT "Hello"</lang>


=== {{header|ZX Spectrum Basic}} ===
=== {{header|ZX Spectrum Basic}} ===


10 REM The top left corner is at position 0,0
<lang basic> 10 REM The top left corner is at position 0,0
20 REM So we subtract one from the coordinates
20 REM So we subtract one from the coordinates
30 PRINT AT 5,2 "Hello"
30 PRINT AT 5,2 "Hello"</lang>

=={{header|Batch File}}==

=={{header|COBOL}}==


=={{header|PureBasic}}==
=={{header|PureBasic}}==
Line 33: Line 21:
Print("Hello")</lang>
Print("Hello")</lang>


=={{header|Rexx}}==
==[[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:
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]]===
===[[regina]]===


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


=={{header|UNIX Shell}}==

Revision as of 08:41, 5 October 2010

Terminal control/Cursor positioning is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

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.

BASIC

Locomotive Basic

<lang basic> 10 LOCATE 3,6

20 PRINT "Hello"</lang>

ZX Spectrum Basic

<lang 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"</lang>

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:

regina

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