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
BASIC09
(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!
===Data types=== BASIC09 included several built-in data types. In addition to the traditional string (STRING) and 40-bit floating point (REAL) types found in most BASICs of the era, it also included the 16-bit signed INTEGER, the 8-bit unsigned BYTE, and the logical BOOLEAN type. The BOOLEAN types were not [[Data structure alignment|packed]] into bytes, a single BOOLEAN used an entire 8-bit byte to store a single value. The language provided separate bytewise [[boolean function|boolean operators]] for bitwise operations on BYTEs and INTEGERs.{{sfn|Manual|1984|pp=7.2-7.6}} In contrast to other BASICs that also operated different base types, BASIC09 did not "decorate" the variable name to indicate the type, and instead used the <code>DIM</code> for definitions; for instance, <code>DIM a,b:BOOLEAN</code> to declare two BOOLEAN variables, or <code>DIM c(5):INTEGER</code> for an array of five INTEGERs.{{sfn|Manual|1984|p=7.6}} Additionally, BASIC09 included the <code>TYPE</code> keyword, which allowed compound types to be defined, with each "element" listed on a single line separated by semicolons. For instance:{{sfn|Manual|1984|p=7.8}} TYPE employee_record=name:STRING;number(2):INTEGER;former:BOOLEAN defines an employee record type named <code>employee_record</code> with three elements, <code>name</code>, <code>number</code> and <code>former</code>. The employee_record type can now be used in a definition like any other type, for instance, <code>DIM employees(100):employee_record</code>, which defines an array of 100 employee_record's. The elements are accessed in code using dot notation, for instance, <code>employees(50).name="Bob"</code>.{{sfn|Manual|1984|p=7.8}}
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)