473,785 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

'Faking' input to QBasic program with VB .NET 2005 application

All -

I was asked to work on a project converting some weather data. The
program used to convert the data is written in Quick Basic. I am only a
novice programmer and while I can see from the .BAS file what is
happening, I don't have the time bandwidth to rewrite the program in VB
..NET and I'm not sure it would do a proper conversion even if I did.

The compiled QB program asks for three inputs... 1) source file
location (string), 2) interval for averaging (int) and 3) output
location (string).

My question for anyone with Quick Basic experience is this - is there a
way to 'fake' this user input so that I could call the old QB program
from and 'pass' the input parameters programmaticall y such that the QB
program will think I'm manually responding to the prompts??

Many thanks in advance -
Danielle

Jan 18 '07 #1
7 1716
Well there is a challenge one doesn't hear ever day :-) QBasic...

I don't know if you can redirect the input (possibly) but a couple of
options come to mind. One is to contact the folks here:
http://www.qbasic.com/. The other is to add a few lines of code to the QB
program to accepts the inputs on the command line and to comment out the
spot where it currently requests input. You should be able to run the
program from your dotnet program and supply the values it wants on the
command line.

One other thing you could do with reasonably few changes is have the the QB
program read a text file to obtain the answers it needs (there are only 3
inputs.) The dotnet program would generate the "inputs.txt " file and run
the QB program which would read that file instead of prompting for the
answers.

In any case you might check with folks at that website.
Tom

"Danielle" <wx****@aol.com wrote in message
news:11******** *************@v 45g2000cwv.goog legroups.com...
All -

I was asked to work on a project converting some weather data. The
program used to convert the data is written in Quick Basic. I am only a
novice programmer and while I can see from the .BAS file what is
happening, I don't have the time bandwidth to rewrite the program in VB
.NET and I'm not sure it would do a proper conversion even if I did.

The compiled QB program asks for three inputs... 1) source file
location (string), 2) interval for averaging (int) and 3) output
location (string).

My question for anyone with Quick Basic experience is this - is there a
way to 'fake' this user input so that I could call the old QB program
from and 'pass' the input parameters programmaticall y such that the QB
program will think I'm manually responding to the prompts??

Many thanks in advance -
Danielle

Jan 18 '07 #2
Tom,

I did want to write something the same, this if you ask yourself if you
should have done that. I am often in doubt after that I have given this kind
of answers.

Cor
Jan 18 '07 #3

To help you on your way the inputs on the command line = command$ ( the
parameters that you give while starting the program )
In my opinion this proggy could be verry easy rewritten in VB.Net or is it a
hughe code file ?
regards

Michel
"Cor Ligthert [MVP]" <no************ @planet.nlschre ef in bericht
news:ep******** *****@TK2MSFTNG P06.phx.gbl...
Tom,

I did want to write something the same, this if you ask yourself if you
should have done that. I am often in doubt after that I have given this
kind of answers.

Cor

Jan 18 '07 #4
Michel Posseth [MCP] wrote:
To help you on your way the inputs on the command line = command$ ( the
parameters that you give while starting the program )
In my opinion this proggy could be verry easy rewritten in VB.Net or is it a
hughe code file ?

I agree with Michel that re-writing the program in VB.net should not be
too difficult however, if you don't want to do that, you can use the
Process class in .Net and re-direct the standard input and output to
your vb.Net program. Then you can supply the necessary information as
the program prompts for it. This assumes that the QBasic program uses
standard input and output.

Jan 18 '07 #5
Thanks to all for the very helpful suggestions. I will look into the
Process class, but suspect that the Command$ input may be the way I go.
Thanks again!
Danielle

Jan 18 '07 #6
To answer the questin about how easy it would be to rewrite - it's a
small program but the data it works on is very specific and also stored
in some sort of wacky format. I don't feel confident that I can get the
output I need, while I am sure that the old qbasic program will out put
the right stuff. So, I think the command line suggestion is in first
place now...

Danielle

Jan 19 '07 #7
One might also look into the SendKeys method...

"Danielle" <wx****@aol.com wrote in message
news:11******** **************@ 11g2000cwr.goog legroups.com...
To answer the questin about how easy it would be to rewrite - it's a
small program but the data it works on is very specific and also stored
in some sort of wacky format. I don't feel confident that I can get the
output I need, while I am sure that the old qbasic program will out put
the right stuff. So, I think the command line suggestion is in first
place now...

Danielle

Jan 19 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
9452
by: jas | last post by:
I have a basic client/server socket situation setup....where the server accepts a connection and then waits for commands. On the client side, I create a socket, connect to the server...then I pass the socket to a class which just reads from the socket (in a thread). class Reader(Thread): def run(self): while 1:
3
3697
by: | last post by:
I am working on a web/webservice application that has a service layer. Most service methods will perform an access-check before executing. This check uses the IPrincipal credentials available in HttpContext.Current. This works great. My issue is that I need to write unit tests for those service methods. These tests then run outside of IIS, thus there is no HttpContext.Current available - and the servicemethod will not execute. The two...
15
4779
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is not validate based on some given rules. I also have a custom error handling page to show the...
1
4375
by: tiddwaylll | last post by:
Hi, I have a huge program written in old BASIC. In fact I don't really know what flavour its written in, looks like qbasic I think. I don't need to know what the program does, I just need to run it. It runs perfectly fine on powerbasic DOS 3.0 . But I dont have powerbasic and I dont want to buy it either. But I do have MS Visual Studio .NET 2008. And I created a console application, which pointed out to a multitude of errors. Most...
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.