# Direct mode

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Direct_mode
> Markdown URL: https://mediated.wiki/source/Direct_mode.md
> Source: https://en.wikipedia.org/wiki/Direct_mode
> Source revision: 1195701428
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|In computing, immediate execution of commands}}
{{Distinguish|immediate mode (computer graphics)}}
In computing, '''direct''' or '''immediate mode'''<ref>{{cite web|url=http://www.6502.org/users/sjgray/computer/rtclinks/rtclink2-manual.pdf|title=Immediate Mode}}</ref><ref>{{cite web|url=http://www.commodore.ca/manuals/128_system_guide/sect-03a.htm|title=C128 System Guide: Section 3}}</ref> in an interactive programming system is the immediate execution of [commands](/source/Command_(computing)), [statements](/source/Statement_(computer_science)), or [expressions](/source/Expression_(computer_science)). In many interactive systems, most of these can both be included in programs or executed directly in a [read–eval–print loop](/source/read%E2%80%93eval%E2%80%93print_loop) (REPL).

Most interactive systems also offer the possibility of defining programs in the REPL, either with explicit declarations, such as [Python](/source/Python_(programming_language))'s <code>def</code>, or by labelling them with [line number](/source/line_number)s. Programs can then be run by calling a named or numbered procedure or by running a main program.

Many programming systems, from [Lisp](/source/Lisp) and [JOSS](/source/JOSS) to [Python](/source/Python_(programming_language)) and [Perl](/source/Perl) have interactive [REPL](/source/REPL)s which also allow defining programs. Most [integrated development environment](/source/integrated_development_environment)s offer a direct mode where, during [debugging](/source/Debugger) and while the program execution is suspended, commands can be executed directly in the current scope and the result is displayed.

== Example ==

;Non-direct mode in Basic{{sxhl|2=basic|
 10 PRINT "HELLO WIKIPEDIA"
 READY.
 RUN
 HELLO WIKIPEDIA
 READY.
}}
;Direct mode in Basic{{sxhl|2=basic|
 PRINT "HELLO WIKIPEDIA"
 HELLO WIKIPEDIA
 READY.
}}

== References ==
{{reflist}}

Category:User interfaces
Category:Computing terminology

---
Adapted from the Wikipedia article [Direct mode](https://en.wikipedia.org/wiki/Direct_mode) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Direct_mode?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
