ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
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)

More Related Content

Viewers also liked (18)

Brain Behind, Body Forward
Brain Behind, Body ForwardBrain Behind, Body Forward
Brain Behind, Body Forward
BASPCAN
?
Why SWAY
Why SWAYWhy SWAY
Why SWAY
Sharyn Coleman
?
The State as party to child maltreatment - lessons from Research on the impac...
The State as party to child maltreatment - lessons from Research on the impac...The State as party to child maltreatment - lessons from Research on the impac...
The State as party to child maltreatment - lessons from Research on the impac...
BASPCAN
?
MMP Preview 2
MMP Preview 2MMP Preview 2
MMP Preview 2
Jennifer Birnel
?
Andrew Paladino- Starting a Network of Influence Complete
Andrew Paladino- Starting a Network of Influence Complete Andrew Paladino- Starting a Network of Influence Complete
Andrew Paladino- Starting a Network of Influence Complete
Andrew Paladino
?
Repechage prezentacja wersja 1
Repechage prezentacja wersja 1 Repechage prezentacja wersja 1
Repechage prezentacja wersja 1
barbararepechage
?
Top 8 network support engineer resume samples
Top 8 network support engineer resume samplesTop 8 network support engineer resume samples
Top 8 network support engineer resume samples
corejom
?
???? ????? ???????
???? ????? ??????????? ????? ???????
???? ????? ???????
Reda Elkholy
?
los salesianos en contratacion-santanderlos salesianos en contratacion-santander
los salesianos en contratacion-santander
jabiero
?
Salesforce for a graduate
Salesforce for a graduateSalesforce for a graduate
Salesforce for a graduate
Cloud Analogy
?
UPDATED RESUME
UPDATED RESUMEUPDATED RESUME
UPDATED RESUME
saleem basha
?
Eje cafeteroEje cafetero
Eje cafetero
nataly-paulina
?
Open Candidate _Jobs you may be interested in linked in2016
Open Candidate _Jobs you may be interested in linked in2016Open Candidate _Jobs you may be interested in linked in2016
Open Candidate _Jobs you may be interested in linked in2016
Shihoko Inagaki
?
Michael t boudreau
Michael t boudreauMichael t boudreau
Michael t boudreau
Michael Boudreau
?
6 magalh?es et al 2008 a hyaluronidase from potamotrygon motoro (freshwater
6  magalh?es et al 2008 a hyaluronidase from potamotrygon motoro (freshwater6  magalh?es et al 2008 a hyaluronidase from potamotrygon motoro (freshwater
6 magalh?es et al 2008 a hyaluronidase from potamotrygon motoro (freshwater
pryloock
?
Photoshoot Plan
Photoshoot Plan Photoshoot Plan
Photoshoot Plan
Amelia Morris
?
Get Your Board to Say "Yes" to a BSIMM Assessment
Get Your Board to Say "Yes" to a BSIMM AssessmentGet Your Board to Say "Yes" to a BSIMM Assessment
Get Your Board to Say "Yes" to a BSIMM Assessment
Cigital
?
Brazendale et al. 2015 - Children¡¯s Enjoyment and Perceived Competence in Phy...
Brazendale et al. 2015 - Children¡¯s Enjoyment and Perceived Competence in Phy...Brazendale et al. 2015 - Children¡¯s Enjoyment and Perceived Competence in Phy...
Brazendale et al. 2015 - Children¡¯s Enjoyment and Perceived Competence in Phy...
Keith Brazendale
?
Brain Behind, Body Forward
Brain Behind, Body ForwardBrain Behind, Body Forward
Brain Behind, Body Forward
BASPCAN
?
The State as party to child maltreatment - lessons from Research on the impac...
The State as party to child maltreatment - lessons from Research on the impac...The State as party to child maltreatment - lessons from Research on the impac...
The State as party to child maltreatment - lessons from Research on the impac...
BASPCAN
?
Andrew Paladino- Starting a Network of Influence Complete
Andrew Paladino- Starting a Network of Influence Complete Andrew Paladino- Starting a Network of Influence Complete
Andrew Paladino- Starting a Network of Influence Complete
Andrew Paladino
?
Repechage prezentacja wersja 1
Repechage prezentacja wersja 1 Repechage prezentacja wersja 1
Repechage prezentacja wersja 1
barbararepechage
?
Top 8 network support engineer resume samples
Top 8 network support engineer resume samplesTop 8 network support engineer resume samples
Top 8 network support engineer resume samples
corejom
?
los salesianos en contratacion-santanderlos salesianos en contratacion-santander
los salesianos en contratacion-santander
jabiero
?
Salesforce for a graduate
Salesforce for a graduateSalesforce for a graduate
Salesforce for a graduate
Cloud Analogy
?
Eje cafeteroEje cafetero
Eje cafetero
nataly-paulina
?
Open Candidate _Jobs you may be interested in linked in2016
Open Candidate _Jobs you may be interested in linked in2016Open Candidate _Jobs you may be interested in linked in2016
Open Candidate _Jobs you may be interested in linked in2016
Shihoko Inagaki
?
6 magalh?es et al 2008 a hyaluronidase from potamotrygon motoro (freshwater
6  magalh?es et al 2008 a hyaluronidase from potamotrygon motoro (freshwater6  magalh?es et al 2008 a hyaluronidase from potamotrygon motoro (freshwater
6 magalh?es et al 2008 a hyaluronidase from potamotrygon motoro (freshwater
pryloock
?
Get Your Board to Say "Yes" to a BSIMM Assessment
Get Your Board to Say "Yes" to a BSIMM AssessmentGet Your Board to Say "Yes" to a BSIMM Assessment
Get Your Board to Say "Yes" to a BSIMM Assessment
Cigital
?
Brazendale et al. 2015 - Children¡¯s Enjoyment and Perceived Competence in Phy...
Brazendale et al. 2015 - Children¡¯s Enjoyment and Perceived Competence in Phy...Brazendale et al. 2015 - Children¡¯s Enjoyment and Perceived Competence in Phy...
Brazendale et al. 2015 - Children¡¯s Enjoyment and Perceived Competence in Phy...
Keith Brazendale
?

Similar to Visual 51 (20)

LESSON 1- VISUAL BASIC PROGRAMMING.ppt
LESSON 1- VISUAL BASIC PROGRAMMING.pptLESSON 1- VISUAL BASIC PROGRAMMING.ppt
LESSON 1- VISUAL BASIC PROGRAMMING.ppt
ChristopherOlaya1
?
Unit 1 vb study_materials
Unit 1 vb study_materialsUnit 1 vb study_materials
Unit 1 vb study_materials
gayaramesh
?
Devry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-startedDevry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-started
govendaagoovenda
?
Devry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-startedDevry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-started
noahjamessss
?
Lesson 4 Introduction to Human Computer Interaction.pptx
Lesson 4 Introduction to Human Computer Interaction.pptxLesson 4 Introduction to Human Computer Interaction.pptx
Lesson 4 Introduction to Human Computer Interaction.pptx
EllenGracePorras
?
CIS 170 Inspiring Innovation/tutorialrank.com
 CIS 170 Inspiring Innovation/tutorialrank.com CIS 170 Inspiring Innovation/tutorialrank.com
CIS 170 Inspiring Innovation/tutorialrank.com
jonhson110
?
CIS 170 Effective Communication - tutorialrank.com
CIS 170 Effective Communication - tutorialrank.comCIS 170 Effective Communication - tutorialrank.com
CIS 170 Effective Communication - tutorialrank.com
Bartholomew19
?
Cis 170 i lab 1 of 7
Cis 170 i lab 1 of 7Cis 170 i lab 1 of 7
Cis 170 i lab 1 of 7
helpido9
?
Cis 170 ilab 1 of 7
Cis 170 ilab 1 of 7Cis 170 ilab 1 of 7
Cis 170 ilab 1 of 7
comp274
?
CIS 170 Exceptional Education - snaptutorial.com
CIS 170   Exceptional Education - snaptutorial.comCIS 170   Exceptional Education - snaptutorial.com
CIS 170 Exceptional Education - snaptutorial.com
DavisMurphyB33
?
Cis 170 Education Organization / snaptutorial.com
Cis 170 Education Organization / snaptutorial.comCis 170 Education Organization / snaptutorial.com
Cis 170 Education Organization / snaptutorial.com
Baileya126
?
Retail store management system project report.pdf
Retail store management system project report.pdfRetail store management system project report.pdf
Retail store management system project report.pdf
Kamal Acharya
?
CIS 170 Become Exceptional--cis170.com
CIS 170 Become Exceptional--cis170.comCIS 170 Become Exceptional--cis170.com
CIS 170 Become Exceptional--cis170.com
claric131
?
Cis 170 Education Organization -- snaptutorial.com
Cis 170   Education Organization -- snaptutorial.comCis 170   Education Organization -- snaptutorial.com
Cis 170 Education Organization -- snaptutorial.com
DavisMurphyB99
?
Cis 170 c Enhance teaching / snaptutorial.com
Cis 170 c  Enhance teaching / snaptutorial.comCis 170 c  Enhance teaching / snaptutorial.com
Cis 170 c Enhance teaching / snaptutorial.com
HarrisGeorg51
?
CIS 170 Education Specialist / snaptutorial.com
CIS 170  Education Specialist / snaptutorial.comCIS 170  Education Specialist / snaptutorial.com
CIS 170 Education Specialist / snaptutorial.com
McdonaldRyan138
?
CIS 170 Life of the Mind/newtonhelp.com? ?
CIS 170 Life of the Mind/newtonhelp.com? ?CIS 170 Life of the Mind/newtonhelp.com? ?
CIS 170 Life of the Mind/newtonhelp.com? ?
llflowe
?
CIS 170 Imagine Your Future/newtonhelp.com? ?
CIS 170 Imagine Your Future/newtonhelp.com? ?CIS 170 Imagine Your Future/newtonhelp.com? ?
CIS 170 Imagine Your Future/newtonhelp.com? ?
bellflower42
?
Containers Lab
Containers Lab Containers Lab
Containers Lab
Dev_Events
?
Cis 170 Extraordinary Success/newtonhelp.com
Cis 170 Extraordinary Success/newtonhelp.com  Cis 170 Extraordinary Success/newtonhelp.com
Cis 170 Extraordinary Success/newtonhelp.com
amaranthbeg143
?
LESSON 1- VISUAL BASIC PROGRAMMING.ppt
LESSON 1- VISUAL BASIC PROGRAMMING.pptLESSON 1- VISUAL BASIC PROGRAMMING.ppt
LESSON 1- VISUAL BASIC PROGRAMMING.ppt
ChristopherOlaya1
?
Unit 1 vb study_materials
Unit 1 vb study_materialsUnit 1 vb study_materials
Unit 1 vb study_materials
gayaramesh
?
Devry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-startedDevry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-started
govendaagoovenda
?
Devry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-startedDevry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-started
noahjamessss
?
Lesson 4 Introduction to Human Computer Interaction.pptx
Lesson 4 Introduction to Human Computer Interaction.pptxLesson 4 Introduction to Human Computer Interaction.pptx
Lesson 4 Introduction to Human Computer Interaction.pptx
EllenGracePorras
?
CIS 170 Inspiring Innovation/tutorialrank.com
 CIS 170 Inspiring Innovation/tutorialrank.com CIS 170 Inspiring Innovation/tutorialrank.com
CIS 170 Inspiring Innovation/tutorialrank.com
jonhson110
?
CIS 170 Effective Communication - tutorialrank.com
CIS 170 Effective Communication - tutorialrank.comCIS 170 Effective Communication - tutorialrank.com
CIS 170 Effective Communication - tutorialrank.com
Bartholomew19
?
Cis 170 i lab 1 of 7
Cis 170 i lab 1 of 7Cis 170 i lab 1 of 7
Cis 170 i lab 1 of 7
helpido9
?
Cis 170 ilab 1 of 7
Cis 170 ilab 1 of 7Cis 170 ilab 1 of 7
Cis 170 ilab 1 of 7
comp274
?
CIS 170 Exceptional Education - snaptutorial.com
CIS 170   Exceptional Education - snaptutorial.comCIS 170   Exceptional Education - snaptutorial.com
CIS 170 Exceptional Education - snaptutorial.com
DavisMurphyB33
?
Cis 170 Education Organization / snaptutorial.com
Cis 170 Education Organization / snaptutorial.comCis 170 Education Organization / snaptutorial.com
Cis 170 Education Organization / snaptutorial.com
Baileya126
?
Retail store management system project report.pdf
Retail store management system project report.pdfRetail store management system project report.pdf
Retail store management system project report.pdf
Kamal Acharya
?
CIS 170 Become Exceptional--cis170.com
CIS 170 Become Exceptional--cis170.comCIS 170 Become Exceptional--cis170.com
CIS 170 Become Exceptional--cis170.com
claric131
?
Cis 170 Education Organization -- snaptutorial.com
Cis 170   Education Organization -- snaptutorial.comCis 170   Education Organization -- snaptutorial.com
Cis 170 Education Organization -- snaptutorial.com
DavisMurphyB99
?
Cis 170 c Enhance teaching / snaptutorial.com
Cis 170 c  Enhance teaching / snaptutorial.comCis 170 c  Enhance teaching / snaptutorial.com
Cis 170 c Enhance teaching / snaptutorial.com
HarrisGeorg51
?
CIS 170 Education Specialist / snaptutorial.com
CIS 170  Education Specialist / snaptutorial.comCIS 170  Education Specialist / snaptutorial.com
CIS 170 Education Specialist / snaptutorial.com
McdonaldRyan138
?
CIS 170 Life of the Mind/newtonhelp.com? ?
CIS 170 Life of the Mind/newtonhelp.com? ?CIS 170 Life of the Mind/newtonhelp.com? ?
CIS 170 Life of the Mind/newtonhelp.com? ?
llflowe
?
CIS 170 Imagine Your Future/newtonhelp.com? ?
CIS 170 Imagine Your Future/newtonhelp.com? ?CIS 170 Imagine Your Future/newtonhelp.com? ?
CIS 170 Imagine Your Future/newtonhelp.com? ?
bellflower42
?
Cis 170 Extraordinary Success/newtonhelp.com
Cis 170 Extraordinary Success/newtonhelp.com  Cis 170 Extraordinary Success/newtonhelp.com
Cis 170 Extraordinary Success/newtonhelp.com
amaranthbeg143
?

Recently uploaded (20)

Shibpur_ IIEST_Preliminary Round Impetus Quiz Fest by Rudra Chakraborty BQC
Shibpur_ IIEST_Preliminary Round Impetus Quiz Fest by Rudra Chakraborty BQCShibpur_ IIEST_Preliminary Round Impetus Quiz Fest by Rudra Chakraborty BQC
Shibpur_ IIEST_Preliminary Round Impetus Quiz Fest by Rudra Chakraborty BQC
Rudra Chakraborty
?
Crossing the assault course: Seeing the pitfalls before you fall into them we...
Crossing the assault course: Seeing the pitfalls before you fall into them we...Crossing the assault course: Seeing the pitfalls before you fall into them we...
Crossing the assault course: Seeing the pitfalls before you fall into them we...
Association for Project Management
?
Fillable Strategies for Understanding and Supporting Neurodivergent Multiling...
Fillable Strategies for Understanding and Supporting Neurodivergent Multiling...Fillable Strategies for Understanding and Supporting Neurodivergent Multiling...
Fillable Strategies for Understanding and Supporting Neurodivergent Multiling...
Sean Fisher
?
What do students really understand about academic integrity? International Ce...
What do students really understand about academic integrity? International Ce...What do students really understand about academic integrity? International Ce...
What do students really understand about academic integrity? International Ce...
Thomas Lancaster
?
Rass MELAI : an Internet MELA Quiz Finals - El Dorado 2025
Rass MELAI : an Internet MELA Quiz Finals - El Dorado 2025Rass MELAI : an Internet MELA Quiz Finals - El Dorado 2025
Rass MELAI : an Internet MELA Quiz Finals - El Dorado 2025
Conquiztadors- the Quiz Society of Sri Venkateswara College
?
How to Use Odoo 17 Consignment to Manage Your Inventory
How to Use Odoo 17 Consignment to Manage Your InventoryHow to Use Odoo 17 Consignment to Manage Your Inventory
How to Use Odoo 17 Consignment to Manage Your Inventory
Celine George
?
The Simple Present Tense, the Verb BE.pdf
The Simple Present Tense, the Verb BE.pdfThe Simple Present Tense, the Verb BE.pdf
The Simple Present Tense, the Verb BE.pdf
NetziValdelomar1
?
Computer Network Unit IV - Lecture Notes - Network Layer
Computer Network Unit IV - Lecture Notes - Network LayerComputer Network Unit IV - Lecture Notes - Network Layer
Computer Network Unit IV - Lecture Notes - Network Layer
Murugan146644
?
N.C. DPI's 2023 Language Diversity Briefing
N.C. DPI's 2023 Language Diversity BriefingN.C. DPI's 2023 Language Diversity Briefing
N.C. DPI's 2023 Language Diversity Briefing
Mebane Rash
?
Adrenergic Transmission & Adrenergic Drugs
Adrenergic Transmission & Adrenergic DrugsAdrenergic Transmission & Adrenergic Drugs
Adrenergic Transmission & Adrenergic Drugs
Dr C Vignesh
?
Integrative Creative Works of Selected Philippines and SEA arts.pptx
Integrative Creative Works of Selected Philippines and SEA arts.pptxIntegrative Creative Works of Selected Philippines and SEA arts.pptx
Integrative Creative Works of Selected Philippines and SEA arts.pptx
BeauDarrylPanizales
?
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptxTLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
RizaBedayo
?
Introduction of secondary metabolities.pptx
Introduction of secondary metabolities.pptxIntroduction of secondary metabolities.pptx
Introduction of secondary metabolities.pptx
Ms. Pooja Bhandare
?
South Hornsey: The Lost Local Authority that Merged with Stoke Newington by T...
South Hornsey: The Lost Local Authority that Merged with Stoke Newington by T...South Hornsey: The Lost Local Authority that Merged with Stoke Newington by T...
South Hornsey: The Lost Local Authority that Merged with Stoke Newington by T...
History of Stoke Newington
?
VE7_Q4W4D2.pptxBaitang 7 Edukasyon sa Pagpapahalaga
VE7_Q4W4D2.pptxBaitang 7 Edukasyon sa PagpapahalagaVE7_Q4W4D2.pptxBaitang 7 Edukasyon sa Pagpapahalaga
VE7_Q4W4D2.pptxBaitang 7 Edukasyon sa Pagpapahalaga
chezeltaylan1
?
Storytelling instructions...............
Storytelling instructions...............Storytelling instructions...............
Storytelling instructions...............
Alexander Benito
?
Chapter 3. Social Responsibility and Ethics in Strategic Management
Chapter 3. Social Responsibility and Ethics in Strategic ManagementChapter 3. Social Responsibility and Ethics in Strategic Management
Chapter 3. Social Responsibility and Ethics in Strategic Management
Rommel Regala
?
Lesson Plan M1 2024 Lesson Plan M1 2024 Lesson Plan M1 2024 Lesson Plan M1...
Lesson Plan M1 2024  Lesson Plan M1 2024  Lesson Plan M1 2024  Lesson Plan M1...Lesson Plan M1 2024  Lesson Plan M1 2024  Lesson Plan M1 2024  Lesson Plan M1...
Lesson Plan M1 2024 Lesson Plan M1 2024 Lesson Plan M1 2024 Lesson Plan M1...
pinkdvil200
?
A PPT Presentation on William Hazlitt's On the Love of Life
A PPT Presentation on William Hazlitt's On the Love of LifeA PPT Presentation on William Hazlitt's On the Love of Life
A PPT Presentation on William Hazlitt's On the Love of Life
Beena E S
?
CBSE Arabic Grammar - Class 10 ppt.pptx
CBSE Arabic Grammar - Class 10   ppt.pptxCBSE Arabic Grammar - Class 10   ppt.pptx
CBSE Arabic Grammar - Class 10 ppt.pptx
suhail849886
?
Shibpur_ IIEST_Preliminary Round Impetus Quiz Fest by Rudra Chakraborty BQC
Shibpur_ IIEST_Preliminary Round Impetus Quiz Fest by Rudra Chakraborty BQCShibpur_ IIEST_Preliminary Round Impetus Quiz Fest by Rudra Chakraborty BQC
Shibpur_ IIEST_Preliminary Round Impetus Quiz Fest by Rudra Chakraborty BQC
Rudra Chakraborty
?
Crossing the assault course: Seeing the pitfalls before you fall into them we...
Crossing the assault course: Seeing the pitfalls before you fall into them we...Crossing the assault course: Seeing the pitfalls before you fall into them we...
Crossing the assault course: Seeing the pitfalls before you fall into them we...
Association for Project Management
?
Fillable Strategies for Understanding and Supporting Neurodivergent Multiling...
Fillable Strategies for Understanding and Supporting Neurodivergent Multiling...Fillable Strategies for Understanding and Supporting Neurodivergent Multiling...
Fillable Strategies for Understanding and Supporting Neurodivergent Multiling...
Sean Fisher
?
What do students really understand about academic integrity? International Ce...
What do students really understand about academic integrity? International Ce...What do students really understand about academic integrity? International Ce...
What do students really understand about academic integrity? International Ce...
Thomas Lancaster
?
How to Use Odoo 17 Consignment to Manage Your Inventory
How to Use Odoo 17 Consignment to Manage Your InventoryHow to Use Odoo 17 Consignment to Manage Your Inventory
How to Use Odoo 17 Consignment to Manage Your Inventory
Celine George
?
The Simple Present Tense, the Verb BE.pdf
The Simple Present Tense, the Verb BE.pdfThe Simple Present Tense, the Verb BE.pdf
The Simple Present Tense, the Verb BE.pdf
NetziValdelomar1
?
Computer Network Unit IV - Lecture Notes - Network Layer
Computer Network Unit IV - Lecture Notes - Network LayerComputer Network Unit IV - Lecture Notes - Network Layer
Computer Network Unit IV - Lecture Notes - Network Layer
Murugan146644
?
N.C. DPI's 2023 Language Diversity Briefing
N.C. DPI's 2023 Language Diversity BriefingN.C. DPI's 2023 Language Diversity Briefing
N.C. DPI's 2023 Language Diversity Briefing
Mebane Rash
?
Adrenergic Transmission & Adrenergic Drugs
Adrenergic Transmission & Adrenergic DrugsAdrenergic Transmission & Adrenergic Drugs
Adrenergic Transmission & Adrenergic Drugs
Dr C Vignesh
?
Integrative Creative Works of Selected Philippines and SEA arts.pptx
Integrative Creative Works of Selected Philippines and SEA arts.pptxIntegrative Creative Works of Selected Philippines and SEA arts.pptx
Integrative Creative Works of Selected Philippines and SEA arts.pptx
BeauDarrylPanizales
?
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptxTLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
RizaBedayo
?
Introduction of secondary metabolities.pptx
Introduction of secondary metabolities.pptxIntroduction of secondary metabolities.pptx
Introduction of secondary metabolities.pptx
Ms. Pooja Bhandare
?
South Hornsey: The Lost Local Authority that Merged with Stoke Newington by T...
South Hornsey: The Lost Local Authority that Merged with Stoke Newington by T...South Hornsey: The Lost Local Authority that Merged with Stoke Newington by T...
South Hornsey: The Lost Local Authority that Merged with Stoke Newington by T...
History of Stoke Newington
?
VE7_Q4W4D2.pptxBaitang 7 Edukasyon sa Pagpapahalaga
VE7_Q4W4D2.pptxBaitang 7 Edukasyon sa PagpapahalagaVE7_Q4W4D2.pptxBaitang 7 Edukasyon sa Pagpapahalaga
VE7_Q4W4D2.pptxBaitang 7 Edukasyon sa Pagpapahalaga
chezeltaylan1
?
Storytelling instructions...............
Storytelling instructions...............Storytelling instructions...............
Storytelling instructions...............
Alexander Benito
?
Chapter 3. Social Responsibility and Ethics in Strategic Management
Chapter 3. Social Responsibility and Ethics in Strategic ManagementChapter 3. Social Responsibility and Ethics in Strategic Management
Chapter 3. Social Responsibility and Ethics in Strategic Management
Rommel Regala
?
Lesson Plan M1 2024 Lesson Plan M1 2024 Lesson Plan M1 2024 Lesson Plan M1...
Lesson Plan M1 2024  Lesson Plan M1 2024  Lesson Plan M1 2024  Lesson Plan M1...Lesson Plan M1 2024  Lesson Plan M1 2024  Lesson Plan M1 2024  Lesson Plan M1...
Lesson Plan M1 2024 Lesson Plan M1 2024 Lesson Plan M1 2024 Lesson Plan M1...
pinkdvil200
?
A PPT Presentation on William Hazlitt's On the Love of Life
A PPT Presentation on William Hazlitt's On the Love of LifeA PPT Presentation on William Hazlitt's On the Love of Life
A PPT Presentation on William Hazlitt's On the Love of Life
Beena E S
?
CBSE Arabic Grammar - Class 10 ppt.pptx
CBSE Arabic Grammar - Class 10   ppt.pptxCBSE Arabic Grammar - Class 10   ppt.pptx
CBSE Arabic Grammar - Class 10 ppt.pptx
suhail849886
?

Visual 51

  • 1. 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. 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. 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. 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. 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. 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. 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)