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!
===Program statements=== Every line in a FOCAL program must start with a line number. As with JOSS, line numbers are fixed-point numbers consisting of two two-digit integers separated by a period. In FOCAL-8, valid line numbers range from 1.01 through 31.99. When printed out, using {{code|WRITE}}, the FOCAL equivalent to BASIC's {{code|LIST}}, leading zeros will be added; 1.10 will be printed as {{code|01.10}}. This makes all lines numbers five characters long when output so that all line numbers align. Statements referring to those lines do not need the leading zeros, for example, {{code|GOTO 1.10}}.{{sfn|Manual|1968|p=2.7}} The number on the left of the period is known as the "group number". Groups provide some level of code organization that is lacking in languages like Fortran or BASIC. The primary use of these was to use a group as a [[subroutine]] which can be called with {{code|DO}}, for example, {{code|DO 5}} will jump to the subroutine written in group 5. The editor also used these during edit-time, for example, one could {{code|WRITE 2}} to produce a listing of the code in group 2, or {{code|ERASE 4}} to delete all of the lines in group 4.{{sfn|Manual|1968|p=2.7}} Every line must start with a command keyword following the line number.{{sfn|Manual|1968|p=2.7}} There is no concept of a "default command" as is the case in BASIC with its optional {{code|LET}} statement. Multiple statements can be placed on a single line, separated by semicolons. Usually, the behavior is no different than if the statements had been on separate lines, except in the case of FOR loops.{{sfn|Manual|1968|p=3.7}}
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)