Mover Fix
Volume Number: 4
Issue Number: 12
Column Tag: Basic School
QuickBasic's Statement Mover Fix
By Dave Kelly, Editorial Board
Statement Mover Fix
During the past month, I’ve been looking at the demo programs included with MS
QuickBASIC 1.0. The programs exercise most of (but certainly not all) the syntax of
QuickBASIC. Also utility programs are provided which can be used to help your
development are:
‘AlertMover’ For copying Alert/Dialog resources
‘Cursor Editor’ For defining your own cursors
‘Demo Resources’ containing Alert resources
‘extra MBLC Remover’ removes unnecessary library resources from your
application programs.
‘Pattern Editor’ For defining your own patterns
‘Print Listing File’ Print listings created at compile time.
‘renumber CODEs’ avoids code id conflicts
‘SortSub’ moves sub programs to the end of a Basic source
code file
‘Statement Mover’ moves resources e specially Library resources.
Missing from this list is a variable cross reference program and a program to
compare the differences between two text files. Comparing differences between files is
somewhat complex when programs don’t have line numbers to compare with.
The new version of ‘Statement Mover’ is much improved over the version
included with MS BASIC 3.0 and the CLR Libraries. You can now copy most any kind of
resource that has a resource name attached. But, don’t open up an open resource file
or you get a bomb! That means you can’t open the System File or the ‘Statement
Mover’ application. I haven’t worked on a fix for that one yet, but I have made a minor
improvement to ‘Statement Mover’ which uses a dialog resource.
The routine I have written replaces the NewTypeDialog subprogram in ‘Statement
Mover’. First the program’s volume reference number is retrieved and the dialog is
displayed. Then a loop is set up to retrieve changes in the modal dialog. When a radio
button is pressed the routine responds to it and updates the other buttons. The buttons
represent a set of resource types which might be moved from one program or file to
another. The edit field is updated with the resource type so that it will be passed when
the routine is exited.
The dialog resource may be created with ResEdit or any other program that
allows you to create dialogs. I used ProtoTyper™ to create the dialog so that I could try
it out before I copied it into my QuickBASIC program. Because I had so many buttons in
my dialog I used ResEdit to adjust the order of the buttons so that the ‘OK’ button would
be the first one (ProtoTyper™ sets them up in the order that they were drawn and you
can’t change the order without starting over).
Another thing that this dialog resource shows is a way to create the bold default
buttons. Normally in Pascal or C you can draw the bold with the FrameRoundRect
statement after defining the dialog item as a user item. A method that works is to
define a PICT resource that looks like the bold roundrect and position it around the
button which will be the default (usually the ‘OK’ button). I believe that you can do it
this way from other languages too, although Inside Macintosh vol. 1 says to use the