PrettyCoolWorkshop
New Member
- Joined
- Feb 23, 2018
- Messages
- 3
I need some help with a project at work. I need to translate A BUNCH (about 10,000 lines) of old VB6 code into something that will run on modern computers, and I think excel's VBA is the best choice (for IT/security reasons, they won't let me go around installing any sort of VB6 runtimes on our new computers). This project was written in VB6 sometime in the 80's, and currently we are only able to run it on one old computer we have laying around. Excel's VBA (I'm experienced in it) is very structurally / semantically similar to VB6, so it should minimize mistakes.
My question to you guys- these old programs are typically written in a style intended for a command prompt user. They ask for input, then make some computations and do some conditional branching, then ask for input again. What is the best way to emulate a command prompt interface in excel VBA?
A sample of the existing code (used to calculate screw thread dimensions) is shown below, to help give you guys an idea of what I need:
The closest thing I imagine to this is to create a userform with two textboxes- one as an input area and one as an output area. I should be able to call these two functions:
1. print(string1): displays the text of string1 to the output area. Easy.
2. input(string1): displays the text of string1 to the output area, and then waits for user input before proceeding to the next line. I don't know how to do this!
My question to you guys- these old programs are typically written in a style intended for a command prompt user. They ask for input, then make some computations and do some conditional branching, then ask for input again. What is the best way to emulate a command prompt interface in excel VBA?
A sample of the existing code (used to calculate screw thread dimensions) is shown below, to help give you guys an idea of what I need:
80 PRINT "ENTER THE THREAD TYPE."
90 PRINT " "
100 INPUT "Enter 1-Std thrds. 2-Metric thrds. 3-Special thrds. 4-EXIT PROGRAM";IEB
110 PRINT " "
120 IF IEB=4 THEN SYSTEM
140 IF IEB=1 THEN 170
150 IF IEB=3 THEN 170
160 PRINT "Enter all values in millimeters"
170 INPUT "Enter Nominal major diameter";D
180 PRINT " "
190 INPUT "Enter product thread length";L1
200 PRINT " "
210 INPUT "Enter thread Included angle";AN
220 PRINT " "
230 IF IEB=2 THEN 460
The closest thing I imagine to this is to create a userform with two textboxes- one as an input area and one as an output area. I should be able to call these two functions:
1. print(string1): displays the text of string1 to the output area. Easy.
2. input(string1): displays the text of string1 to the output area, and then waits for user input before proceeding to the next line. I don't know how to do this!