Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
FOCAL (programming language)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Environment commands== === Running programs === FOCAL used {{code|GOTO}} in the editor to start a program. However, a rule-of-thumb was to shorten this to {{code|GO}}. This is the equivalent of {{code|RUN}} in BASIC. {{code|GOTO}} can also be used in the editor to start execution at a specified line. === Editing commands === New lines are entered into a program by simply starting the command with a line number. The editing commands were <code>ERASE</code> (abbreviation E),{{sfn|Manual|1968|p=2.4}} <code>MODIFY</code> (abbreviation M),{{sfn|Manual|1968|p=3.8}} and <code>WRITE</code> (abbreviation W):{{sfn|Manual|1968|p=3.2}} * <code>ERASE</code> β zero out all variables; this is sometimes used in programs to reset them * <code>ERASE ''line number''</code> β delete the statement at a specified line * <code>ERASE ''group number''</code> β delete all statements in a specified group * <code>ERASE ALL</code> β delete an entire program * <code>MODIFY ''line number''</code> β allow editing a specified line * <code>WRITE ''line number''</code> β display the statement at a specified line * <code>WRITE ''group number''</code> β display all statements in a specified group * <code>WRITE ALL</code> β display a specified program === File commands === The file command was OPEN (abbreviation O): * {{code|OPEN INPUT [device:][file][,ECHO]}} β prepare to read from the start of a file * {{code|OPEN OUTPUT [device:][file][,ECHO]}} β prepare to write from the start of a file * {{code|OPEN RESTORE INPUT[,ECHO]}} β resume input * {{code|OPEN RESTORE OUTPUT[,ECHO]}} β resume output * {{code|OUTPUT CLOSE}} β output the buffer and close a file === Library commands === FOCAL included the ability to manage collections of FOCAL programs as a code library. Programs could call other programs in a chain fashion using <code>LIBRARY CALL</code>, or call a single subroutine in another program using <code>LIBRARY GOSUB</code>. Program names could be six characters long. The LIBRARY command (abbreviation L) had the following sub-commands: * <code>LIBRARY DELETE [device:]''program name''</code> β delete a program * <code>LIBRARY LIST [device:][file name]</code> β catalog * <code>LIBRARY RUN [device:]''program name'' [line number]</code> β chain a program, optionally resuming at a specified line number * <code>LIBRARY SAVE [device:]''program name''</code> β save a program * <code>LIBRARY EXIT</code> β return to the PDP-8 monitor program FOCAL-71 added: * <code>LIBRARY CALL [device:]''program name''</code> β load a program * <code>LIBRARY GOSUB [device:]''program name'' [group number]</code> β call a subroutine in an external program
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)