HOW TO MODIFY OLD QBASIC PROGRAMS TO RUN IN VISUAL BASIC



Similar documents
2. More Use of the Mouse in Windows 7

RDM+ Remote Desktop for Mobiles For Blackberry Playbook

Introduction to the use of the environment of Microsoft Visual Studio 2008

In this example, Mrs. Smith is looking to create graphs that represent the ethnic diversity of the 24 students in her 4 th grade class.

APPLYING BENFORD'S LAW This PDF contains step-by-step instructions on how to apply Benford's law using Microsoft Excel, which is commonly used by

HOWTO annotate documents in Microsoft Word

How to Edit an . Here are some of the things you can do to customize your

Getting Started on the Computer With Mouseaerobics! Windows XP

Using Excel to find Perimeter, Area & Volume

Petrel TIPS&TRICKS from SCM

Spreadsheet. Parts of a Spreadsheet. Entry Bar

File Management Where did it go? Teachers College Summer Workshop

Using Report Writer. Introduction

Millennium Learning Centres How to scan documents you want to edit

Windows 8 Quick Start Guide

Getting to know your computer

Quickstart for Desktop Version

HEALTH MANAGEMENT SYSTEM RESISTANCE EXERCISE MODULE TABLE OF CONTENTS

Programming in Access VBA

Switching from PC SAS to SAS Enterprise Guide Zhengxin (Cindy) Yang, inventiv Health Clinical, Princeton, NJ

Advanced Presentation Features and Animation

Sample Table. Columns. Column 1 Column 2 Column 3 Row 1 Cell 1 Cell 2 Cell 3 Row 2 Cell 4 Cell 5 Cell 6 Row 3 Cell 7 Cell 8 Cell 9.

How To Understand How To Use A Computer On A Macintosh (Apple) Computer With A Mouse And Mouse (Apple Macintosh)

Table of Contents TASK 1: DATA ANALYSIS TOOLPAK... 2 TASK 2: HISTOGRAMS... 5 TASK 3: ENTER MIDPOINT FORMULAS... 11

ANIMATED FRACTALS. nature very complex. In the classroom, it can be very instructive to watch the fractal image

PEMBINA TRAILS SCHOOL DIVISION. Information Technology Department. Inspiration 7.0

itunes 4.2 User Guide for Windows Apple Computer, Inc.

PEMBINA TRAILS SCHOOL DIVISION. Information Technology Department

Microsoft Word defaults to left justified (aligned) paragraphs. This means that new lines automatically line up with the left margin.

Access 2007 Creating Forms Table of Contents

Quick Guide. Passports in Microsoft PowerPoint. Getting Started with PowerPoint. Locating the PowerPoint Folder (PC) Locating PowerPoint (Mac)

A Quick Start Guide to Using PowerPoint For Image-based Presentations

Instructions for Formatting MLA Style Papers in Microsoft Word 2010

Publisher 2010 Cheat Sheet

Finding and Opening Documents

Creating Calculated Fields in Access Queries and Reports

How To Insert Hyperlinks In Powerpoint Powerpoint

Task Card #2 SMART Board: Notebook

Basic Introduction. GMFX MetaTrader 4.0. Basic Introduction

Quick Start Guide. Microsoft Publisher 2013 looks different from previous versions, so we created this guide to help you minimize the learning curve.

Using FileMaker Pro with Microsoft Office

What is Microsoft PowerPoint?

TOPAZ. Using Windows XP with service pack 2. GE Security. Supplement Revision A January 15, 2005

Acrobat PDF Forms - Part 2

Introduction to the UNIX Operating System and Open Windows Desktop Environment

Database Concepts (3 rd Edition) APPENDIX D Getting Started with Microsoft Access 2007

Metatrader 4 Tutorial

PowerPoint 2013: Basic Skills

**If the box does not automatically pop up, see the next page.

SecureLock. User Manual

Instructions for Creating a Poster for Arts and Humanities Research Day Using PowerPoint

MS Access Lab 2. Topic: Tables

Tutorial: Get Running with Amos Graphics

Outlook Operating Instructions. Internal Desktop Access

User's Guide. RecoveryExpert. Compute with confidence

Microsoft PowerPoint 2010 Computer Jeopardy Tutorial

Basic Website Creation. General Information about Websites

Introduction. Why Use ODBC? Setting Up an ODBC Data Source. Stat/Math - Getting Started Using ODBC with SAS and SPSS

Intellect Platform - The Workflow Engine Basic HelpDesk Troubleticket System - A102

Web Conferencing Demo and Tutorial

Canterbury Maps Quick Start - Drawing and Printing Tools

Windows 8.1 Tips and Tricks

IN THE WORKSHOP Tip #14

HOW TO CREATE A SCANNED DIGITAL SIGNATURE AND INSERT INTO A PDF DOCUMENT

Spreadsheet - Introduction

Microsoft Excel 2007 and Tools for Statistical Analysis David R. Anderson, Dennis J. Sweeney, and Thomas A. Williams

Chapter 9 Input/Output Devices

Microsoft Publisher 2010 What s New!

Publisher 2010 Create an Event Flyer

Managing Contacts in Outlook

Creating forms in Microsoft Access 2007

Draw pie charts in Excel

DOING MORE WITH WORD: MICROSOFT OFFICE 2010

College of Continuing Education Video Production Room

Tutorial: Get Running with Amos Graphics

Working with Visio Connectors

Getting Started With SPSS

After going through this lesson you would be able to:

SFTP Server User Login Instructions. Open Internet explorer and enter the following url:

Microsoft Office PowerPoint Identify components of the PowerPoint window. Tutorial 1 Creating a Presentation

Installation and Demonstration Manual

Created by the St. Dorothy s Project Team Updated by Oksana Maibroda

Excel 2007: Basics Learning Guide

TUTORIAL 4 Building a Navigation Bar with Fireworks

Creating a Form. A form is something that is created allowing users to enter information in a more visual manner than a datasheet view.

Microsoft PowerPoint 2008

SECTION 2-1: OVERVIEW SECTION 2-2: FREQUENCY DISTRIBUTIONS

Computer Basics: Tackling the mouse, keyboard, and using Windows

File Management Using Microsoft Windows

Gerrit Stols

How to Use Gmail. 1. Using your computer s Internet browser direct yourself to the Gmail website:


Using Excel As A Database

[Not for Circulation]

Web Conferencing Loading Content

Appointments Module. User s Manual

This activity will show you how to draw graphs of algebraic functions in Excel.

Microsoft Access is an outstanding environment for both database users and professional. Introduction to Microsoft Access and Programming SESSION

Creating PDF Forms in Adobe Acrobat

Introduction to Microsoft Access 2003

Transcription:

1 HOW TO MODIFY OLD QBASIC PROGRAMS TO RUN IN VISUAL BASIC Seth Bergmann, Computer Science Department Tirupathi R. Chandrupatla, Mechanical Engineering Thomas J. Osler, Mathematics Department Rowan University Glassboro NJ 08028 bergmann@rowan.edu chandrupatla@rowan.edu osler@rowan.edu 1. INTRODUCTION It is the purpose of this short article to show QuickBASIC (also known as QBasic, GW-BASIC and IBM BASIC) programmers how to perform simple modifications to their old programs so that they will run in Visual Basic. QuickBASIC interpreters are no longer available. Yet, QuickBASIC was one of the most popular programming languages in the world ten years ago. Many QuickBASIC programmers now have hundreds of programs that will run only on their old DOS based interpreters. Professors with QuickBASIC software sometimes feel like dinosours when they show DOS based programs to their students. Yet QuickBASIC was a great language. It was easy to learn and the interpreter was small enough to fit on a diskette with ample room for programs as well. It had great graphics capabilities that were easy to implement. New languages like C++ do not have all these nice features. In place of QuickBASIC, Microsoft now markets Visual Basic. Fortunately, Visual Basic code is identical to QuickBASIC code with only a few exceptions.

2 Unfortunately, getting started with Visual Basic can be discouraging because there are so many options available. Worse, all the books on Visual Basic are big and thick. You have to read 200 pages before you learn to write a program that will solve a simple mathematical problem. As you will see, it is both easy and inexpensive to get started with Visual Basic. We will show you how to use your knowledge of QuickBASIC so that you can write useful programs that run in Visual Basic. We cannot teach you the powerful new features of Visual Basic. For that you will have to read hundreds of pages. 2. GETTING STARTED FAST Readers who do not own Visual Basic can obtain the so called Control Creation Edition 5 or the Working Model Edition 6 on CD as well as a book describing the language at any book store. (See [1] and [2] which sell for less than $20.) This is a great bargain. We purchased [2] and used it for all the material shown in this paper. Now perform the following simple steps: 1. Prepare your old QuickBASIC code by saving your code in ascii (text) format. 2. Start the Visual Basic program, and click on the Standard EXE option that appears on your screen. You should see a screen that looks like Figure 1. Complicated isn t it! Don t worry, we will show you only the features that are necessary. The rectangle in the middle of the screen labeled Form1 is called the form. Think of it as a window. This is where all the action takes place.

3 Figure 1: The Visual Basic form 3. Place a command button on the form by clicking on the button marked A shown in Figure 2. Next move the mouse pointer onto the form and drag it a bit and you will see a command button appear on your form as in Figure 3. Figure 2: Selecting options A: Command Button; B: View Code; C: View Object

4 Figure 3: A command button placed on the form 4. Double click on the command button that you just placed on the form. The window to hold your Visual Basic code now opens as in Figure 4. This is where we must insert your old Quick BASIC file. Figure 4: Preparing to enter the code 5. Now we will enter your old Quick BASIC code. Click on Edit on the tool bar and select the insert file option. Find the old BASIC program you saved in step 1 as an ascii file it will appear on your Visual Basic window. This should resemble Figure 5.

5 Figure 5: Paste or type in the code 6. Next you must change a few of your old Quick BASIC commands. Use the following Table to make the necessary changes. QuickBASIC Code Visual Basic Code 1 DATA 20, 55, 33, 98 2 DEFDBL A - Z unnecessary - all calculations done in double precision, including functions 3 A$ = INKEY$ 4 INPUT Enter number ; A A = InputBox( Enter number ) 6 LPRINT Hello 7 SCREEN 12 delete this line 8 WINDOW (-10,20)-(30, 0) Scale (-10,20)-(30,0) Of course, you could simply type the program into the window as an alternative to inserting an old file. 7. Notice that clicking on the View Object button marked C in Figure 2 leaves the code window and returns you to the original form window. Clicking on the View Code button marked B in Figure 2 displays the code window again. 3. EXECUTING THE PROGRAM

6 You are now ready to run your program. Click on Run on the tool bar and select start. The form with the command button will appear. Simply click on the command button and the program should execute. Our program generates the Mandelbrot set on the form as seen in Figure 6. Figure 6: The form after executing the program Of course, you could have increased the size of the form before executing the program by clicking on the little square in the upper right hand corner. To end the program click on Run on the tool bar and select the end option. 8. You save your project (programs are called projects in Visual Basic) in the usual way by clicking on File on the tool bar and selecting the Save project option. The files are automatically saved in ASCII format. Opening old Visual Basic projects is equally familiar. 4. FINAL REMARKS

7 The inexpensive Control Creation Edition of Visual Basic that we used to run our programs is a true bargain. We ran a numerical calculation that took 104 seconds in our QuickBASIC interpreter, but only required 63 seconds on Visual Basic. Another unexpected feature is the high precision of the mathematical functions. Under QuickBASIC functions like SIN returned single precision values (7 digits). The Visual Basic returns 15 digits! REFERENCES [1] Mansfield, Richard, Visual Basic 6 Weekend Crash Course, M&T Books, Foster City, CA, 2000. (Contains CD with Visual Basic 6 Working Model Edition. $19.99) [2] Perry, Greg, Sams Teach Yourself Visual Basic 5 in 24 Hours, Sams Pub., Indianapolis, Indiana, 1997. (Conains CD with Visual Basic Control Creation Edition 5. $19.95)