Interactive programming (repl): Difference between revisions

Applesoft BASIC
m (Petelomax moved page Interactive programming to Interactive programming (repl): make it easier to find)
(Applesoft BASIC)
Line 74:
ACL2 !>(good-bye)
</pre>
 
=={{header|Arturo}}==
<pre>➜ $ arturo
Line 105 ⟶ 104:
PRINT FN f$("Rosetta", "Code", ":")</lang>
 
==={{header|Applesoft BASIC}}===
The Apple II comes with BASIC in Read Only Memory (ROM.) When the Apple II plus and later models are powered on with no disk drives attached, the Applesoft BASIC prompt appears.
<pre>
]
</pre>
If a drive is attached, press RESET or Ctrl+RESET before the disk boots to get to the Applesoft BASIC prompt.
 
The original Apple II comes with Integer BASIC in ROM.
<pre>
>
</pre>
With an Applesoft ROM card, or a 16K RAM "Language" card in slot 0, you can boot from the DOS 3.3 System Master to load DOS and if needed it will load Applesoft into the Language card. Type the DOS 3.3 command FP "Floating Point" to get to the Applesoft BASIC prompt. There is also an older cassette tape version of Applesoft BASIC.
 
You can also get to Applesoft Basic from the Monitor.
<pre>
*
</pre>
Type E000G to cold start Applesoft which clears the program and variables. Or, type E003G to warm start Applesoft.
 
The two modes are RUN mode, and the default "DIRECT" mode. In direct mode, spaces are ignored except within strings. Entering ? is shorthand for the PRINT keyword. Using GET, INPUT, or DEF FN will result in an ?ILLEGAL DIRECT ERROR. The DATA statement is ignored.
<lang gwbasic>] 0 IF F$ = "F" THEN RESULT$ = P1$ + P3$ + P3$ + P2$: END
 
] F$ = "F":P1$ = "ROSETTA":P2$ = "CODE":P3$ = ":": GOTO
 
] ?RESULT$
ROSETTA::CODE</lang>
=={{header|Batch File}}==
CMD.EXE is the CLI for Batch Files. Batch Files do not have traditional functions and doing the [http://rosettacode.org/wiki/Call_a_function#Batch_File alternative] will not work in interactive mode. So this example uses blocks of code.
413

edits