Anonymous user
Terminal control/Positional read: Difference between revisions
Terminal control/Positional read (view source)
Revision as of 00:54, 19 December 2011
, 12 years ago→{{header|AutoHotkey}}: inline the function -- it was crap anyway
(→{{header|AutoHotkey}}: Submit AutoHotkey example) |
(→{{header|AutoHotkey}}: inline the function -- it was crap anyway) |
||
Line 5:
=={{header|AutoHotkey}}==
{{works with|AutoHotkey_L}}
<p>AutoHotkey is not built for the command line, so we need call the WinAPI directly.</p><p>For fun, this writes random characters to the command window so that it has something to retrieve. </p>
<lang AHK>DllCall( "AllocConsole" ) ; create a console if not launched from one
hConsole := DllCall( "GetStdHandle", int, STDOUT := -11 )
Loop
WriteConsole(hConsole, RandChars(7) "`n")▼
Random, asc, % asc("A"), % Asc("Z")▼
WriteConsole(hConsole, Chr(asc))
}▼
}
MsgBox % ReadConsoleOutputCharacter(hConsole, 1, 3, 6)
Line 35 ⟶ 42:
return out
return 0
▲}
▲ Loop % n
▲ {
▲ Random, asc, % asc("A"), % Asc("Z")
▲ }
}</lang>
|