Information for teachers

Liberty BASIC FAQ (updated Dec 27, 2003)

Summary of FAQ Questions:

  • What is Liberty BASIC?
  • What are the minimum hardware and software requirements for Liberty BASIC?
  • What sort of software can I write in Liberty BASIC?
  • How does Liberty BASIC compare with Visual Basic?
  • How does Liberty BASIC compare with QBASIC?
  • What is the most recent version of Liberty BASIC?
  • Where can I get a copy of Liberty BASIC?
  • What is shareware?
  • How much does it cost to purchase Liberty BASIC?
  • Where can I obtain a CDROM containing Liberty BASIC and lots of goodies?
  • What books are available for use with Liberty BASIC?
  • Does Liberty BASIC have an educational discount?
  • Is Liberty BASIC a compiler?
  • How does the Liberty BASIC runtime engine work?
  • Can you make standalone applications with the shareware version?
  • What do you mean by 'create standalone applications'?
  • So, how do I package a distribution version of my program?
  • Is there any way to use sprites in Liberty Basic?
  • How do I get Liberty Basic to stop playing a .wav file when the window has been Minimised (for a more professional presentation)?
  • How do I program the PC printer port in LB?
  • Does Liberty BASIC come with a visual GUI builder (like VB)?
  • How does one print source code from Liberty BASIC?
  • Does Liberty BASIC support the LPRINT command for sending text to a printer?
  • Can you make internet apps in Liberty BASIC?
  • I have a registered version of LB that I received from College. How do I access the runtime engine?
  • What code should I use in my Liberty BASIC program to test if a file exists?
  • Can Liberty BASIC use Active-X?
  • I've registered my copy of lb. It says in startup.bas that my password is related to my name. HOW???!!
  • How do I play a wav file in Liberty BASIC?
  • Where can I find additional tutorials for Liberty BASIC?

    Answers to Liberty BASIC FAQ Questions follow:

    Q: What is Liberty BASIC?
    A: Liberty BASIC is a easy to learn programming language for Windows (and OS/2). Use it to create custom utilities, business applications, games or programs that control lab equipment. Liberty BASIC consists of an integrated editor, compiler, and debugger. It also comes with a graphical interface editor called FreeForm, which is itself written in Liberty BASIC. In fact, the latest version of FreeForm includes enhancements submitted by Liberty BASIC users.

  • PC Magazine nominated Liberty BASIC twice for best shareware programming tool in their annual Ziff Davis Shareware Awards.
  • NRI Schools (a correspondence school run by McGraw Hill Publishers) uses Liberty BASIC as an introduction to Windows programming.
  • Q: What are the minimum hardware and software requirements for Liberty BASIC?
    A: Any computer with a Pentium or 486 processor. Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000, and Windows XP all work with Liberty BASIC. You need only about 7MB of disk space to install, and Liberty BASIC uses up about 5MB of RAM when started up.

    Q: What sort of software can I write in Liberty BASIC?
    A: You can write all kinds. Games, utilities, engineering, education, business applications, etc.

    Q: How does Liberty BASIC compare with VisualBasic?
    A: A short comparison of Liberty BASIC versus VisualBasic: Liberty BASIC is a more classical version of the BASIC language, sort of like QBasic, but it has commands for creating windows, buttons, listboxes, etc. and for doing graphics. It also has a traditional code editor and a nice debugger. Liberty BASIC is free to try, and only $29.95 to purchase. Visual Basic is a much bigger language, which focuses more on editing GUI widgets and adding code to the widgets. Some people find this hard to work with. Visual Basic costs a lot of money.

    Q: How does Liberty BASIC compare with QBASIC?
    A: Liberty BASIC is a programming language similar to, but not directly compatible with QBASIC. If you want to use your QBasic programs with Liberty BASIC you will need to modify them. If you have ever programmed in any version of Microsoft BASIC, Liberty BASIC will be easy to learn. Liberty BASIC incorporates those things that make programming easy and fun, and it adds what's needed for programming graphical user interfaces (something QBASIC lacks).

    Q: What is the most recent version of Liberty BASIC?
    A: The latest Windows version is Liberty BASIC v4.0, released Nov 20, 2003. The OS/2 version is currently v0.91 (a very old version, but free).

    Q: Where can I get a copy of Liberty BASIC?
    A: The shareware version which can be downloaded at
    http://www.libertybasic.com/download.html.

    Q: What is shareware?
    A: Shareware is a marketing method. Another name for shareware is "try before you buy." Read the shareware FAQ at the Association of Shareware Professionals website for more information:
    http://www.asp-shareware.org/1-faq.asp#share

    Q: How much does it cost to purchase Liberty BASIC?
    A: Liberty BASIC costs $29.95 for the SILVER version, and $49.95 for the GOLD version. The SILVER version removes the 30-day trial limitation. The GOLD version also removes the 30-day limitation and also activates the runtime engine so you can create standalone programs.

    Q: Where can I obtain a CDROM containing Liberty BASIC and lots of goodies?
    A: You can order the special Value Edition of Liberty BASIC which includes a copy of Alyce Watson's excellent ebook for Liberty BASIC entitled "Mastering Liberty BASIC 3"

    Q: What books are available for use with Liberty BASIC? There are at least 3 books in print that teach or use Liberty BASIC. Follow this link: http://www.libertybasic.com/resources.html#books

    Q: Does Liberty BASIC have an educational discount?
    A: Yes. Simply buy one copy for your classroom. All the students are covered under this license. You agree to encourage your students to register it themselves if they use it outside of their classwork.

    Q: Is Liberty BASIC a compiler?
    A: What most people mean when they ask this question is "Does Liberty BASIC make machine language executables (exe files)?" The answer is no. Liberty BASIC is a compiler though but it doesn't compile to machine language, but to an intermediary execution format, which is executed by a runtime engine (similar to the popular Java programming language's virtual machine concept). When using the runtime engine, you do not have to provide source code.

    Q: How does the Liberty BASIC runtime engine work?
    A: Liberty BASIC runtime applications use the RUN400.EXE runtime engine. This program can be renamed to anything you like, for example MYPROG.EXE. You can change the runtime engine's icon and you can also create your own splash screen (startup graphic). You use the runtime engine by creating a TKN file, which the runtime engine executes. You don't have to give away any of the code you write to produce a standalone application. There are a few DLLs you must include with the runtime engine, but a complete application is only about 1MB when compressed into a ZIP file. NOTE: To use the runtime engine, you must be a registered user of Liberty BASIC.

    Q: Can you make standalone applications with the shareware version?
    A: No. You need to purchase a GOLD license to use the Liberty BASIC runtime engine.

    Q: What do you mean by 'create standalone applications'?
    A: A standalone application is a program which looks and runs like any compiled app. It can have its own icon, and can be run by double-clicking on that icon. You do not need to give away your source code to distribute such an application.

    Q: So, how do I package a distribution version of my program? A:Look in the helpfile under "runtime engine". This is available to gold licensees only. The general method is to make a tkn of your source code, then copy that, all of the DLLs and SLLs, and the runtime engine (run.exe) to a folder, along with any other dependencies, such as bitmaps, data files, wavs, etc. Rename the runtime engine to match the name of the tkn. If the tkn is "hello.tkn" then rename the copy of the runtime engine to "hello.exe". Use the LB icon editor to create and embed the icon of your choice into the runtime engine. You must distribute all of these files for folks to be able to use your program.

    Q: Is there any way to use sprites in Liberty Basic?
    A: Liberty BASIC has sprite animation capabilities. Look in the help file for the section on sprite animation.

    Q: How do I get Liberty Basic to stop playing a .wav file when the window has been Minimised (for a more professional presentation)
    A: Stopping a wave file while it's playing is easy with a simple playwave "", but knowing when a window becomes minimized is more of a trick. You could have a loop which uses the IsIconic API call to detect the change (I guess... anyone who knows can chime in ;-).

    Q: Does Liberty BASIC come with a visual GUI builder (like VB)?
    A: Liberty BASIC comes with FreeForm, which is written in Liberty BASIC. FreeForm lets you draw your windows without writing code, and then it generates code for you. Because it includes source code you can examine it, extend it, and learn from it! Most of the newest features of FreeForm were added by users of Liberty BASIC!

    Q: How does one print source code from Liberty BASIC?
    A: Using the File/Print menu, you can print your source code.

    Q: Does Liberty BASIC support the LPRINT command for sending text to a printer?
    A: Yes, Liberty BASIC supports the LPRINT command, and it also includes a command called DUMP with forces a page to print (like a form feed).

    Q: Can you make internet apps in Liberty BASIC?
    A: Yes, with TCP4W.DLL or FTP4W.DLL. These are libraries available here
    http://perso.wanadoo.fr/philippe.jounin

    Q: I have a registered version of LB that I received from College. How do I access the runtime engine?
    A: Unless you received your copy of Liberty BASIC from NRI Schools, you do not have the registered version. If you did get a copy from NRI, you have the registered version of v1.22. Click here to see our *NRI Schools* page.

    Q: What code should I use in my Liberty BASIC program to test if a file exists?
    A: Use the following, and change "c:\" to the drive and directory path and "config.bak" to the filename you are testing for.

     dim info$(10,10)
     files "c:\", "config.bak", info$()
     if val(info$(0, 0)) > 0 then [theFileExists]

    Q: Can Liberty BASIC use Active-X or COM components?
    A: Liberty BASIC does not support Active-X or COM.

    Q: How do I play a wav file in Liberty BASIC?
    A: All you need to do to play a wave file is use the PLAYWAVE statement. For an example look at the sample program PLAYER.BAS.

    Q: Where can I find additional tutorials for Liberty BASIC?
    A: Follow this link on the Liberty BASIC web site
    http://www.libertybasic.com/resources.html#tutorials

    Q: How can I set the input focus to the control I want when I open a window?
    A: Use the setfocus command just after you open the window. For example, if your control is a textbox named #mywin.tb1 then try: print #mywin.tb1, "!setfocus"; (Replace this with your comment) how do i make a password input that when you type each letter of the key word in stars appear like this ******? cheers Is Microsoft intending to phase out MS-DOS and hence QBASIC, and will this boost interest in BASIC alternatives? I can't get liberty BASIC to run external programs. It keeps telling me that "Windows returned an unknown error 8 while trying to RUN whateveritis.exe". What should I do??? Tried to run a standalone in Windows98 and the DLL files couldn't be read. Why? After a first look the most annoying for is the lacking sub-support. Are local variables and "call sub" supported in 2.0? I can't read the files I create in one LB program with another. If I create them in .txt form I get a cryptic notice saying "file open error" but no means of finding the error. If I create them in .bat form I find I have a file in MS-DOS Batch form that says it is 2 bytes long, 4096 bytes used. I'm using Windows 98. What am I doing wrong? Where can I find the detailed description of the graphic commands (ellipse, circle) elsewhere than in the examples? After I finish making a program, how do I make it into an icon so that I can give the program to monsters else without Liberty Basic, and them be able to use it? do you have lesson plans for teachers?

    Q: I am opening a dialog box with multiple entries. How can I place the cursor in the first entry answer box, it always starts on the 3rd and I must move it with the mouse?
    A: Click here for the answer
    How can I set the input focus to the control I want when I open a window?