• Print

Author Topic: The relationship of the HP BASIC and the QB64 system  (Read 83 times)

anttiylikoski

  • Newbie
  • *
  • Posts: 34
    • Email
The relationship of the HP BASIC and the QB64 system
« on: November 14, 2012, 11:06:20 AM »
What is the relationship of another very well-known and venerable BASIC dialect, the HP BASIC, of the e. g. HP2000B -- HP2000 Access -- HP 3000 minicomputers, and the QB64 BASIC system, I would like to enquire.

The QB64 contains a great deal of enhanced capabilities compared to the original QBASIC; how about making some extensions in order to ease the conversion of HP BASIC programs to the very popular QB64 system........  That would (copyright issues having been considered) bring a large retro program base to the realm of the programs running in the QB64 universe.

I wonder if this would be meaningful.... That HP BASIC is old, namely.

yours sincerely, Antti J Ylikoski
Helsinki, Finland, the E.U.
antti.ylikoski@gmail.com


Clippy

  • Hero Member
  • *****
  • Posts: 16434
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: The relationship of the HP BASIC and the QB64 system
« Reply #1 on: November 14, 2012, 11:09:47 AM »
I don't recommend anything that HP ever made!  ;)

The only thing QB64 may have in common is the language. You will have to convert them yourself...  ;)
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

TerryRitchie

  • Hero Member
  • *****
  • Posts: 2264
  • FORMAT C:\ /Q /U /AUTOTEST (How to repair Win8)
    • Email
Re: The relationship of the HP BASIC and the QB64 system
« Reply #2 on: November 14, 2012, 02:40:51 PM »
You can support the HP Basic commands through custom subroutines and functions.  For example, HP Basic has a command called ASCII that returns the decimal number of the first character in a string.  You could write a function to emulate this command:

FUNCTION ASCII(evaluate$)
    ASCII = ASC(evaluate$, 1)
END FUNCTION

Now the ASCII command can be used natively as it would be in HP Basic:

Value% = ASCII("Hello World")

Obviously some things about HP Basic will not convert at all, such as using the exclamation point ( ! ) as a remark statement.  QB64 only supports the keywords REM and apostrophe ( ' ).  Also, the use of ampersand ( & ) is not supported for line continuation, instead QB64 supports underscore ( _ ).

Still others would be difficult at best to emulate, such as a WHEN ERROR USE ... /END WHEN to handle errors (which is superior to the way other BASICs, including QB64, handle errors).

But for most commands a comparable sub or function could be created allowing a programmer familiar in HP Basic to feel somewhat at home in the QB64 programming environment.

  • Print