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!
====TYPE ==== The {{code|TYPE}} command (abbreviation T) provides for output of one or more items separated by commas.{{sfn|Manual|1968|p=3.1}} Equivalent to BASIC's {{code|PRINT}}. Items can be variables, literal strings surrounded by double-quotes, or a variety of control characters. The control characters include the {{code|!}} to output a carriage return and line feed, {{code|#}} for the carriage return alone, and {{code|:}} for a tab character. Control characters can be strung together, for example, {{code|!!!}} will output three CR/LFs without the need to separate them with commas.{{sfn|Manual|1968|p=3.2}} TYPE [NUMBERS, E1, "TEXT", !, #, :, $ OR %] ...OUTPUT 01.10 TYPE "HI THERE, GOOD LOOKING. HOW MUCH MONEY DO YOU WANT TO BORROW?",! 01.50 TYPE "INTEREST",INTEREST,! 01.80 TYPE "THE INTEREST FOR",TERM," YEARS",!,"IS",INTEREST, " DOLLARS.",!! 01.90 TYPE "NEW YORK",!,"WASHINGTON",!,"ATLANTA",!,"DALLAS",! 02.10 TYPE "X",X," ","X^2",X^2," ","SQRT",FSQT(X) 03.20 TYPE ".",# 02.20 TYPE !!!!! {{code|TYPE}} also included an optional format specifier indicated using the format {{code|%x.yz}}, where x is the number of digits to the left of the decimal, and yz is the number of digits to the right of the period. The default format was {{code|%8.4}}, meaning a maximum of eight digits and four to the right of the period.{{sfn|Manual|1968|p=2.2}} So, for example: SET A=67823 TYPE %6.01,A = 67823.0 TYPE %5,A = 67823 TYPE %8.03,A = 67823.000 TYPE %,A = 6.7823E4 Note the extra leading spaces in some examples, padding out the full defined width. Using % alone caused the output to be printed in "floating point format" using the E.{{sfn|Manual|1968|p=2.3}} A special control character was {{code|$}} which caused a table of all defined variables and their values to be printed. Only the first two letters of the name will be printed, padded with a zero if need be. Arrays elements are printed on separate lines and variables with only one element will be indexed (00). For example:{{sfn|Manual|1968|p=2.5}} TYPE $ A0(00)=67823
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)