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
VSI BASIC for OpenVMS
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!
{{Short description|Dialect of the BASIC programming language}} {{About|the BASIC dialect created for the OpenVMS operating system, which was previously known as '''HP BASIC for OpenVMS'''|other BASIC dialects created at HP|HP BASIC (disambiguation)}} <!-- The reason for this hatnote is that this article is a popular match for "HP BASIC" in a general web search. A person unfamiliar with the subject matter, arriving via a general web search, might reasonably have difficulty distinguishing these different "HP BASIC" dialects. The hatnote distinguishes the subject matter, not the article titles. --> {{Multiple issues| {{More footnotes|date=July 2013}} {{more citations needed|date=June 2014}} {{notability|date=June 2014}} }} {{Infobox programming language |name = VSI BASIC for OpenVMS |logo = |paradigm = [[imperative programming|imperative]] |year = |designer = |developer = [[Digital Equipment Corporation]] |latest_release_version = |latest_release_date = |typing = |implementations = |dialects = |influenced_by = |influenced = |current version = |operating_system = [[OpenVMS]] |license = |website = }} '''VSI BASIC for OpenVMS''' is the latest name for a dialect of the [[BASIC]] [[programming language]] created by [[Digital Equipment Corporation]] (DEC) and now owned by VMS Software Incorporated (VSI). It was originally developed as [[BASIC-PLUS]] in the 1970s for the [[RSTS-11]] operating system on the [[PDP-11]] minicomputer. It was later ported to [[OpenVMS]], first on [[VAX]], then [[DEC Alpha|Alpha]], [[HPE Integrity Servers|Integrity]], and most recently [[x86-64]]. Past names for the product include: '''BASIC-PLUS''', '''Basic Plus 2''' ('''BP2''' or '''BASIC-Plus-2'''), '''VAX BASIC''', '''DEC BASIC''', '''Compaq BASIC for OpenVMS''' and '''HP BASIC for OpenVMS'''. Multiple variations of the titles noting the hardware platform (VAX, AlphaServer, etc.) also exist. ==Notable features== VSI BASIC has many [[FORTRAN]]-like extensions, as well as supporting the original [[Dartmouth BASIC]] [[array data structure|matrix]] [[operator (computer programming)|operators]]. [[Line number]]s are optional, unless the "ERL" function is present. It allows you to write "WHEN ERROR" [[exception handling|error handlers]] around protected [[statement (computer science)|statements]]. The more traditional but less elegant "ON ERROR" statement lacks such context or scope. One of VSI BASIC's more noteworthy features is built-in support for [[OpenVMS]]'s powerful [[Record Management Services]] (RMS). Before the release VAX BASIC, native RMS support was only available in DEC's [[COBOL]] compiler. ==History== The VSI BASIC for OpenVMS product history spans a period of more than 30 years, and it has gone through many name and ownership changes in that time. It has also been [[porting|ported]] to a succession of new [[computing platform|platforms]] as they were developed by DEC, Compaq, HP and VSI. The company and/or platform name has often been included in the product name, contributing to the proliferation of names. ===BASIC-PLUS=== {{Main|BASIC-PLUS}} VSI BASIC began as '''BASIC-PLUS''', created by DEC for their [[RSTS-11]] [[operating system]] and [[PDP-11]] [[minicomputer]]. Programming language statements could either be typed into the [[command interpreter]] directly, or entered into a [[text editor]], saved to a file, and then loaded into the command interpreter from the file. Errors in source code were reported to the user immediately after the line was entered. Programs were stored as a {{Not a typo|.BAS}} [[source code|source]] file, using the "SAVE" command. It could be "compiled" into a non-editable binary {{Not a typo|.BAC}} file, using the "COMPILE" command. This command did not produce true [[machine language]] programs, but rather a [[byte code]] called "tokens". The tokens were interpreted upon execution, in a manner similar to the more modern [[Java (programming language)|Java]]. Programs were entered into the command interpreter starting with [[line number]]s, integers from 1 to 32767. Lines could be continued onto multiple lines by using a [[line feed]] character. For ease of external editing of the source file, later versions of BASIC-PLUS also allowed the & character as a line-continuation character. Multiple statements could be placed on a single line using {{code|\}} as the statement separator. For PDP-11 systems with virtual memory ([[RSTS/E]]), address space was limited to about 64 [[kilobytes|KB]]. With BASIC-PLUS, about half of this was used by the combined command interpreter and run-time library. This limited user programs to about 32 KB of memory. Older [[RSTS-11]] systems lacked virtual memory, so the user program had to fit into whatever was left of physical memory after RSTS and BASIC-PLUS took up their share. For example, on a PDP-11/35 with 32K of physical memory, running RSTS-11 V04B-17, user programs were limited to 7 KB. Large programs could be broken up into various pieces by use of the "CHAIN" instruction. Programs could [[chain loading|chain]] to specific line numbers in a secondary program. The use of a shared memory section called [[Core common area|core common]] also allowed programs to pass data among each other as needed; [[Hard disk|disk]] files could also be used but were slower. The interpreter included a garbage collecting memory manager, used for both string data and byte-code. A running program could be interrupted, have variables examined and modified, and then be resumed. Many of the control structures used in other high-level languages existed in BASIC-PLUS, including WHILE and UNTIL. The language also supported the use of conditional modifiers on a single line. For example, the line "{{code|2=basic|PRINT I UNLESS I < 10}}" would print the value of "I" unless I was less than 10. ===BASIC Plus 2=== '''Basic Plus 2''' ('''BP2''' or '''BASIC-Plus-2''') was later developed by DEC to add additional features and increase performance. It used true compilation into [[threaded code]], and wrote its output to [[machine language]] [[object file]]s. These were compatible with other object files on the system, and could be assembled into libraries. A linker (the TKB taskbuilder) then created [[executable file]]s from them. TKB also supported overlays; this allowed individual routines to be swapped into the main memory space as needed. BP2 programs ran under [[RSX-11]] or RSTS/E's RSX Run Time System. This RTS only occupied 8KB (later, 2KB) of the user's address space, leaving 56KB for the user's program. These two factors allowed individual BP2 programs to be much larger than BASIC-PLUS programs, often eliminating the need for CHAINing. Unlike BASIC-PLUS (which was only available on RSTS-11), BP2 allowed use on the RSX-11 operating system as well. ===VAX BASIC and DEC BASIC=== With the creation of the [[VAX]] [[minicomputer]], DEC ported BASIC-PLUS-2 to the new [[OpenVMS|VMS]] operating system, and called it '''VAX BASIC'''. VAX BASIC used the standard VMS calling standards, so object code produced by VAX BASIC could be linked with object code produced by any of the other VMS languages. Source code for BASIC Plus 2 would usually run without major changes on VAX BASIC. When DEC created their [[DEC Alpha|Alpha]] [[microprocessor]], VMS was ported to it and renamed [[OpenVMS]]. VAX BASIC was likewise ported to Alpha and renamed '''DEC BASIC'''. The BASIC [[interpreter (computing)|interpreter]] was permanently dropped at this point, which meant that DEC BASIC programs could only be run as OpenVMS [[executable]]s, produced by a [[compiler|compile]] followed by a [[Linker (computing)|link]]. ===Compaq, HP and VSI=== When DEC was purchased by [[Compaq]] in 1997/98, the products were renamed '''Compaq BASIC for OpenVMS VAX''' and '''Compaq BASIC for OpenVMS Alpha'''. Likewise, when [[Compaq]] merged with [[Hewlett-Packard|HP]] in 2001/02, the products were renamed '''HP BASIC for OpenVMS on VAX''' and '''HP BASIC for OpenVMS on AlphaServer'''. HP later released '''HP BASIC for OpenVMS on Integrity''' for their Integrity [[Server (computing)|server]] platforms based upon [[Intel]]'s [[Itanium]] processors. In mid 2014, HP sold the whole OpenVMS ecosystem to VSI who renamed the product '''VSI BASIC for OpenVMS'''.<ref>{{cite web|url=https://vmssoftware.com/docs/VSI_OpenVMS_compilers_and_lpd/basic/VSI_BASIC_User_Manual.pdf|title=VSI BASIC for OpenVMS User Manual|date=2018}}</ref> ==Sample code== {{Main|BASIC#Structured BASIC}} VSI BASIC is a structured variant of BASIC in which line numbers are optional, and the language supports both SUBs and FUNCTIONs. ===Hello, world=== print "Hello, world!" ===Celsius to Fahrenheit conversion=== function real to_fahrenheit(real celsius) to_fahrenheit = (celsius * 1.8) + 32 end function external real function to_fahrenheit(real) declare real temp_celsius when error in print "Enter a temperature in celsius"; input x temp_celsius = real(x) use print "Error: enter a valid numeric value, please." end when print "Temperature in degrees fahrenheit is "; to_fahrenheit(temp_celsius) end ==References== {{Reflist}} ==External links== * [https://support.hpe.com/hpesc/public/docDisplay?docId=emr_na-c04619693 Official BASIC documentation at HP] * [http://neilrieck.net/demo_vms_html/openvms_demo_index.html HP BASIC for OpenVMS "source code demos and examples"] {{BASIC}} [[Category:Articles with example BASIC code]] [[Category:OpenVMS software]] [[Category:BASIC compilers]] [[Category:BASIC programming language family]]
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)
Pages transcluded onto the current version of this page
(
help
)
:
Template:About
(
edit
)
Template:BASIC
(
edit
)
Template:Cite web
(
edit
)
Template:Code
(
edit
)
Template:Infobox programming language
(
edit
)
Template:Main
(
edit
)
Template:Multiple issues
(
edit
)
Template:Not a typo
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)