home *** CD-ROM | disk | FTP | other *** search
- Liberty BASIC v2.02 Release Notes - May 2, 2001
-
- In this file you will find:
-
- - Information about changing the icon for runtime applications
- - A list of new features and bug fixes
-
- Changing the icon for runtime applications
- ==========================================
-
- You can change the icon for the runtime engine. Liberty BASIC
- provides a tool that lets you do this.
-
- To create an icon you can use the icon editor built into Liberty
- BASIC, or you can use a 16-color icon created from some other tool.
-
- Let's walk through this. Let's say I've made a copy of the
- runtime engine called freeform.exe. To install an icon which
- I've already created, I would:
-
- - Start Liberty BASIC if needed
- - Click on the Setup menu and choose Icon Editor
- - Now I'll click on the File menu in the Icon Editor and open
- my icon file, named freeform.ico
- - To install the icon in the freeform.exe file, I will click
- on File and then choose Write Icon To Module
- - Now I'll find the freeform.exe file in the file dialog that
- appears, select it, and click on Ok
- - To install the icon in the vwicons.dll file, I will click on
- File and then choose Write Icon To Module
- - Now I'll find the vwicons.dll file in the file dialog that
- appears, select it, and click on Ok
- - A dialog box will appear. So I would click to select the
- item 10 DEFAULT and then click on Ok.
-
- That's it! I will need to include a copy of the vwicons.dll
- file that I just modified along with the freeform.exe file.
-
-
- New Features for Liberty BASIC v2.02
- ====================================
-
- - The following example programs have been updated because they did
- not work properly with this latest version of Liberty BASIC.
- Thanks for Cameron Arnott for pointing these out!
-
- colorex.bas, graphics.bas, rolodex1.bas, ttt.bas
-
- - The sprites help file was updated to include a section describing
- each sprite related command. Thanks to Alyce Watson for this
- new help file!
-
- - Added an exclamation point button to the IDE toolbar next to
- the question mark button (help). This button opens the release
- notes (this document).
-
- - Fixed! When running a TKN file, functions would often fail
- with an index out of bounds error when returning from calls to
- other functions. This bug was not in effect when running BAS
- programs in the editor.
-
- - Fixed! Liberty BASIC was opening a file named 'go' every time
- it started up. This was preventing it from running from a
- CDROM drive or on a network where read-only permissions were
- in effect.
-
- - Changed the name of the vwfloat.dll to vwfloat2.dll so that it
- doesn't conflict with the floating point library of the same
- name used by Liberty BASIC v1.x. This was causing trouble for
- users who were trying to use both on the same machine.
-
- - Fixed a problem where the floating point library wasn't being
- released when Liberty BASIC exits.
-
- - Fixed a bug in the grabbing of a sprite background. When the
- image needed to be stretched to fit, the height of the bitmap
- was mistakingly stretched to be its width.
-
- - New! Added READ, DATA, and RESTORE! DATA is local to the sub
- or function it is defined in.
-
- - Fixed! Sometimes an array inside of a function or sub was
- not always the same array as named outside of a function or
- sub. This would cause index out of bounds errors, as well as
- some more subtle bugs.
-
- - Extended the SORT command so that you can reverse the order of
- the sort by reversing the order of the range of rows to sort.
-
- 'sort from row 1 to 50
- sort array$(), 1, 50
-
- 'sort reversed from row 1 to 50
- sort array$(), 50, 1
-
- - Added information about READ, DATA, and RESTORE to the help
- files, reorganized the Command Reference to make it easier to
- find stuff, and corrected some mistakes.
-
- New Features for Liberty BASIC v2.01
- ====================================
-
- - Added VWICONS.DLL to the Liberty BASIC distribution. This
- library doesn't seem to be required for Win95 and Win98, but
- is needed for Windows NT (and probably Windows 2000).
-
- - Added the above DLL to the distribution list in the runtime
- engine documentation in the helpfile.
-
- New Features for Liberty BASIC v2.0
- ====================================
-
- - Added the ability to set command line arguments for a TKN
- file when you execute it with a run statement, like so:
-
- run "myprog.tkn these words in CommandLine$ of myprog.tkn"
-
- - Added a STRINGWIDTH? command to the graphics windows. This
- lets you get the width in pixels of a string, based on the
- current font of the graphicbox or graphic window.
-
- open "my stringwidth" for graphics as #g
- name$ = "Carl Gundel"
- print #g, "stringwidth? names$ width"
- print width
-
- - Using the PRINTERDIALOG command will afford the user the
- opportunity for pick a different printer for the next run
- of printing, but then the printer will revert to the default
- printer unless the PRINTERDIALOG command is used again.
- When the user chooses a printer the variables PrinterName$,
- PrintCollate and PrintCopies are set with appropriate values.
-
- - Added RGB color support to the BACKCOLOR and FILL graphics
- commands. For example, now you can do this:
-
- print #handle.ext, "fill 255 100 100"
-
- - Added support for popup style windows and dialog boxes using
- the window_popup and dialog_popup types, for example:
-
- open "title not displayed" for window_popup as #winpop
-
- There is no close button or system menu for this kind of
- window, but you can close it using Alt-F4.
-
- - Added a wait statement. Use this anywhere you want to stop
- and wait for user interaction, instead of using input and a
- dummy variable name.
-
- - Changed the default font to Ms Sans Serif 8 point. This is the
- same font most Windows applications use. The editor, debugger
- and main window still use the font specified under Setup/Editor
- Font.
-
- - Established the new data return mechanism for widgets in
- addition to sprites. You can still use the old form.
-
- Old form:
-
- print #handle.ext, "command";
- input #handle.ext, resultVar
-
- New form:
-
- print #handle.ext, "command resultVar";
-
- - Added syntax coloring to the LB editor!
-
- - Groupboxes now accept handle extensions, so now you can get a
- Windows handle for any groupbox.
-
- groupbox #handle.ext, "My groupbox", 10, 10, 200, 100
-
- - Added graphical sprites to Liberty BASIC! A big thank you goes
- out to Alyce Watson for all her help getting this to work!
-
- The sprite functionality be used with a graphics window or a
- graphicbox. Only one window at a time can have sprites. No
- special setup is required. Just open a window and start adding
- and using sprites. Here is a simple example:
-
- '-- load a sprite image and background
- loadbmp "smiley", "smiley.bmp"
- loadbmp "landscape", "bg1.bmp"
-
- '-- open a window with a graphicbox
- WindowHeight = 300
- WindowWidth = 400
- open "sprite test" for window_nf as #w
- graphicbox #w.g, 0, 0, 400, 300
-
- '-- add a background and sprite to the window
- print #w.g, "background landscape";
- print #w.g, "addsprite smiley smiley";
-
- '-- animate the sprite
- for x = 1 to 100 step 4
- print #w.g, "spritexy smiley "; x; " "; x
- print #w.g, "drawsprites";
- next x
-
- wait
-
- Each sprite can have one or more images. These can be controlled
- explicitly or a sprite can be made to cycle it's images in an
- automatic fashion. A sprite's set of images can also be swapped
- on the fly with another set.
-
- Each sprite has several useful properties like name, position,
- visibility, scale, orientation, and motion.
-
- A form of collision detection lets your program ask for the names
- of sprites which touch any sprite.
-
- The currently supported commands are (please make suggestions!):
-
- background imagename - Use the image specified as a background.
-
- addsprite spritename imagename(s) - Add a sprite using images.
- Repeating this later replaces the images with a new set and
- sets the first images to be the current one. Replacing the
- images does not alter the position, visibility or other
- properties of the sprite with this name.
-
- drawsprites - Update the visual display
-
- spriteimage spritename - Make the image named spritename the
- current image.
-
- spritexy spritename x y - Position a sprite at x, y
-
- spritexy? spritename - Gets the x and y position of the sprite
-
- Acceptable usage:
-
- print #handle.ext, "spritexy? spritename"
- input #handle.ext, x, y
- or
- print #handle.ext, "spritexy? spritename x y"
-
- spritescale spritename percent - Set the size scale of a sprite
-
- spriteorient spritename normal|flip|mirror|rotate180 - Set the
- visual orientation of a sprite
-
- spritevisible off|on - Hide or show a sprite
-
- spritemovexy spritename x y | Move a sprite x, y pixels each
- time it is drawn
-
- cyclesprite spritename frameCount - Each time a sprite is drawn
- use frameCount to make another image the selected frame. A
- value of 1 cycles through each image in turn (-1 backwards)
-
- spritecollide spritename - Gets a string with names of sprites
- that overlap the current frame of the sprite named. Each
- sprite name returned has a space between it.
-
- Acceptable usage:
-
- print #handle.ext, "spritecollide spritename"
- input #handle.ext, list$
- or
- input #handle.ext, "spritecollide spritename list$"
-
- There are several included sprite programs. There are sprite
- images in the sprites subdirectory and there are a couple of blank
- sprites you can use to create your own sprites using Paintbrush.
-
- - Added a TIMER statement. This permits the creation of one
- operating system timer per program. This timer provides a means
- to execute code at a branch label every so many milliseconds.
- Branching will wait until an WAIT, INPUT or SCAN statement is
- encountered.
-
- Acceptable usage:
-
- timer 100, [tenthSec] 'GOTO [label] every 100 ms (milliseconds)
- timer 1000, [oneSec] 'change to 1000 milliseconds and [second]
- timer 0 'turn off the timer
-
- See the clock2.bas program for an example of TIMER.
-
- - Added a SELECT command to the text window and texteditor
- control which will position the cursor at column and row.
-
- print #handle.ext, "!select column row";
-
- - Added a Printer Font menu item to the Setup menu so the
- user can have separate editing and printing fonts.
- NOTE: There is a problem with bitmapped fonts. They get
- translated directly into the resolution of the printer,
- which isn't pretty. I'll have to figure out how to fix
- this, but for now use TrueType fonts like Courier New.
-
- - Added min() and max() functions which return the smaller
- or larger of two values respectively.
-
- - Enhanced the LB editor so that the blinking cursor
- follows the editor's view whenever you page up or down.
-
- - Changed the up and down arrow scrolling so that when you
- reach the top or bottom of the view it scrolls a single
- line at a time, instead of scrolling an amount
- proportional to the editor view.
-
- - Changed shift-scrolling, so that when pushing shift and
- up or down arrow and the top or bottom of the view is
- reached it will scroll and let you to continue selecting.
-
- - Added a File/Insert File... menu item so that a file can
- be inserted into the file being currently edited at the
- current cursor position.
-
- - Added the ability define subroutines using the SUB statement. This
- is similar to defining functions, but no value is returned.
-
- sub subname var1, var2$
- 'some code here
- end sub
-
- To call a subroutine, the CALL statement is used.
-
- call subname expr1, expr2$
-
- See the console3.bas and fform201.bas programs for examples.
-
- - Added the ability to set and read the text field part of a combobox.
- See combo.bas for an example.
-
- - A new option in the preferences panel lets you set a file that will
- always be loaded when Liberty BASIC is launched.
-
- - Added a revamped debug window.
-
- - Enhanced font specification so that fonts can support underscore,
- and strikeout.
-
- for example:
- print #handle, "font courier_new 10 underscore strikeout"
-
- - Enhanced font point size specification. Now if you specify only one
- size value it will use this to set the actual point size of the font.
- The goal of this is to retain backwards compatibility with LB v1.x.
-
- for example to create a 10pt font:
- print #handle, "font times_new_roman 10"
- the old way still ok (it doesn't really create a 10pt font):
- print #handle, "font times_new_roman 0 10"
-
- - Added a FONTDIALOG command. To use it, pass in a font specification
- string and give it a string variable name to return the user's newly
- specified font specification. If the user cancels the dialog box
- the returned value is an empty string. like so:
-
- facename$ = "courier_new"
- pointsize$ = "10"
- modifiers$ = "bold italic"
- fontdialog facename$+" "+pointsize$+" "+modifiers$, newFontSpec$
- print newFontSpec$
-
- Of course the following also works:
-
- fontdialog "courier_new 10 bold italic", newFontSpec$
-
- - Added a set command to the graphics window and graphicbox. It draws
- a single spot using the current pen. If you don't specify a
- location it will draw in the current spot. If you do specify a
- location is will draw the spot there.
-
- print #draw, "set"
-
- or using the following should improve the performance of your
- programs over using place and go.
-
- print #draw, "set 100 100"
-
- - Added a toolbar with buttons to the Liberty BASIC editor
-
- - Improved the performance of the CALLDLL statement. Twice as fast.
-
- - Added two new forms of the time$() function.
-
- time$ = time$() 'this is same old form, and does the same thing
- seconds = time$("seconds") 'returns seconds since midnight
- msecs = time$("milliseconds") 'returns milliseconds since midnight
-
- - Added new forms of the date$() function
-
- print date$() ' Nov 30, 1999
- print date$("mm/dd/yyyy") ' 11/30/1999
- print date$("mm/dd/yy") ' 11/30/99
- print date$("yyyy/mm/dd") ' 1999/11/30 for sorting
- print date$("days") ' 36127 days since Jan 1, 1900
-
- - Added a dechex$() function that produces a hexadecimal representation
- of a decimal value. This is the opposite of the hexdec() function.
-
- hexString$ = dechex$(255) 'produces "FF"
-
- - Added recent files to the LB editor file menu.
-
- - New! Added the ability to use expressions when specifying controls.
-
- - Type checking. The compiler now knows when to expect a parameter or
- value to be a string or a numeric value. For example:
-
- a = "hey there" 'this is acceptable in Liberty BASIC v1.x
- a$ = "hey there" 'string variable names must now end with $
-
- - Color control (see colorex.bas). Two variables, ForegroundColor$
- and BackgroundColor$ let you control color for windows of type window,
- and window_nf. Dialog boxes now automatically have a gray background.
-
- - Popupmenu command. This is just like the menu statement, but it pops
- up a menu anywhere you like.
-
- - User functions with local variables and branch labels. The way it is
- currently implemented all arrays and device handles (for files
- and windows) are globals. Here is an example function
- definition.
-
- print amPmTime$(time$())
-
- function amPmTime$(time$)
-
- colonIndex = instr(time$, ":")
- hours = val(left$(time$, colonIndex - 1))
- amOrPm$ = " AM"
- if hours > 12 then
- hours = hours - 12
- amOrPm$ = " PM"
- else
- if hours = 0 then hours = 12
- end if
- amPmTime$ = str$(hours) + mid$(time$, colonIndex) + amOrPm$
-
- end function
-
- Notice that to return a value, you must set the variable with the
- same name as the function. In the above case, this is amPmTime$.
-
-
- Bug fixes for Liberty BASIC v2.0
- =================================
-
- - Added code to fix a compiler error that said 'read beyond
- end of stream', where it should say 'syntax error'.
-
- - Added a mechanism for compile-time type checking of array
- indexing arguments so that you get a 'type mismatch' error
- at compile time instead of a weird error at runtime.
-
- - Changed dialog boxes so that they will position themselves
- relative to the mouse when opened, instead of being
- positioned at the upper left of the display screen. The
- technique is the same as for non-dialog windows.
-
- - Fixed the compiler so that it halts compiling with a
- syntax error if a line of code begins or ends with a colon
- character.
-
- - Modified the parser so that for commands which specify an
- array you can now include the closing brace. This doesn't
- change any functionality, but it meant to make the code more
- readable. This includes the commands combobox, listbox,
- sort, and files. The old syntax is also still supported.
-
- Example. Instead of:
-
- combobox #main.cb, myArray$(, [handler], x, y, wide, high
-
- you can do this:
-
- combobox #main.cb, myArray$(), [handler], x, y, wide, high
-
- - Fixed the parser so that remarked code that starts with an
- apostrophe ignore anything after them (as they should).
-
- - Set a default mainwin size of 64 columns and 24 lines. This
- takes effect when there is no lbasic.ini file.
-
- - Fixed a bug in the PROMPT and CONFIRM commands where they would
- always assign a string value to the variable specified in the
- command, even if the variable had a numeric name (no $). The
- following now work correctly:
-
- prompt "How many years old are you!"; years
- print "You must be at least "; years * 12; " months old!"
-
- and...
-
- 'yesDelete will be 1 for true, and 0 for false
- confirm "Go ahead and delete customer?"; yesDelete
- if yesDelete then call deleteCustomerId custId
-
- - Changed the BEEP command to play the default system sound
- synchronously.
-
- - Changed the RUN statement (and some other stuff) so that
- when you run a TKN file and it ends, control will return
- to the calling program.
-
- - Fixed! Each time Liberty BASIC was started it would flip the
- order of the recent files because it was writing out the
- opposite order it was reading them in.
-
- - Added code which automatically gives files a .BAS extension
- when you use Save As... and do not specify an extension.
-
- - Fixed! When displaying text in a graphics window semicolons
- can now be included in the text.
-
- - The font command was not being handled by windows and
- dialogs. You can now do something like this to set the font
- for all the controls in a window:
-
- 'define some controls and open a window or dialog and then...
- print #winhandle, "font courier_new 10"
-
- - Rehashed the way that floating point values are displayed
- because many values were losing precision in their printed
- rendering.
-
- - Made the following window type specifiers order insensitive so
- that you can reverse the modifiers:
-
- graphics_nsb_nf = graphics_nf_nsb
- graphics_nsb_fs = graphics_fs_nsb
- text_nsb_ins = text_ins_nsb
- text_fs_nsb = text_nsb_fs
- dialog_nf_fs = dialog_fs_nf
- dialog_modal_nf = dialog_nf_modal
-
- - Fixed a problem with the ^ operator, which wasn't permitting a
- value of zero or less to be raised to a power.
-
- - Fixed: OPEN "comx:????" for random as #handle
- The letters com no longer have to be in uppercase. Previously
- Liberty BASIC complained that the filename was too long if com
- wasn't COM.
-
- - The FILEDIALOG command will now accept string expressions
- instead of only string variable for its title and pathname
- parameters.
-
- - Fixed the printing code so that program listings would
- correctly wrap when lines are too long for the page width.
-
- - Now when a command sent to a GUI control is not understood, Liberty
- BASIC will stop and provide a description of the problem. This will
- make it easier to find certain subtle coding mistakes.
-
- - Controls will now be added in the order they are listed before a
- window is opened. Previously they were added in subgroups which made
- tabbing order difficult to work with.
-
- - cleaned up casting of integer values when floats have no fractional
- part. This affected code in many places.
-
- - fixed! Trying to delete the currently unflushed graphics segment
- resulted in a delete metafile error. Now it will delete the
- segment.
-
- - fixed! Integers were being cast as floats during variable assignment
- in some cases
-
- - The random number generator for rnd() has been improved. Now it
- seems much more random.
-
- - fixed! type checking was added to array assignments at compile time
-
- - New better syntax checking and error reporting. Much less likely to
- see errors like:
- - the collection is empty
- - attempted to access an absent element
-
- - Fonts now include support for italic, bold and underscore. See
- fontpowr.bas for an example.
-