Terminal control/Cursor positioning: Difference between revisions

Add AutoHotkey
(Add AutoHotkey)
Line 3:
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.
[[Terminal Control::task| ]]
=={{header|AutoHotkey}}==
{{works with|AutoHotkey_L}}
Remember that AHK is not built for the console, so we must call the WinAPI directly.
<lang AHK>DllCall( "AllocConsole" ) ; create a console if not launched from one
hConsole := DllCall( "GetStdHandle", int, STDOUT := -11 )
 
DllCall("SetConsoleCursorPosition", UPtr, hConsole, UInt, (6 << 16) | 3)
WriteConsole(hConsole, "Hello")
 
MsgBox
 
WriteConsole(hConsole, text){
VarSetCapacity(out, 16)
If DllCall( "WriteConsole", UPtr, hConsole, Str, text, UInt, StrLen(text)
, UPtrP, out, uint, 0 )
return out
return 0
}</lang>
=={{header|BASIC}}==