16 bit to 32 bit executable in Windows 7 / 64

Thread Starter

cmartinez

Joined Jan 17, 2007
8,212
I have a very old Quick Basic program that I use to generate random numbers that is very useful for a certain application of mine.
The problem is that the program runs in 16 bit mode, and is rejected by Windows 7 - 64 professional.
I do not want to use DosBox, since that would complicate things, and I also do not want to use .NET since it would require downloading all the framework needed for that small program to run in any computer.

Is there a Basic or VB-like language out there that I could use to write the code, compile, and generate a small executable in at least 32-bit mode, so that it could easily run in Win7/64 ?
I don't need fancy dialog boxes or anything, I just want to run the program from the command prompt. The program would then report a series of calculated numbers
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,212
Have you tried running the exe in compatibility mode? Not sure if this will help, just an initial thought.
Win7/64 does not allow 16 bit programs to run, either in compatibility or as administrator.
I'm not against using a graphical user interface, I'm willing to use dialog boxes if necessary. My only concern here is that I do not want to have to download an entire .NET framework whenever I want to use that program in a different computer
 

tshuck

Joined Oct 18, 2012
3,534
You could use VBScript, though it is an interpreted language, it comes with Windows, but you will likely run into issues down the road with availability.

If you want something compiled, you will run into the obsolescence issue you are currently having in the future.
 

DerStrom8

Joined Feb 20, 2011
2,390
Are you familiar with Java? There is a built-in Math library that has a "random" function. And Java applications are portable and cross-platform compatible. It is very easy to write a random number generator program in Java, and most computers already have Java installed.
 

tshuck

Joined Oct 18, 2012
3,534
Are you familiar with Java? There is a built-in Math library that has a "random" function. And Java applications are portable and cross-platform compatible. It is very easy to write a random number generator program in Java, and most computers already have Java installed.
That would be my plug too were it not for the desire to avoid having dependencies that may, or may not exist on a Windows machine.

I'd still recommend it as a possibility though...
 

tshuck

Joined Oct 18, 2012
3,534
Win7/64 does not allow 16 bit programs to run, either in compatibility or as administrator.
I'm not against using a graphical user interface, I'm willing to use dialog boxes if necessary. My only concern here is that I do not want to have to download an entire .NET framework whenever I want to use that program in a different computer
Lots of things run using the .NET framework - you probably already have it installed and may not know it.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,212
Are you familiar with Java? There is a built-in Math library that has a "random" function. And Java applications are portable and cross-platform compatible. It is very easy to write a random number generator program in Java, and most computers already have Java installed.
I know what Java is... but I've never programmed a single line of code in it. Can Java be run as a simple terminal window?
All I need to do is generate 3 numbers (whose equations I already know) and have the user input a 4th number. Then a small text file will be generated with the results.
The numbers are all integers.
 

DerStrom8

Joined Feb 20, 2011
2,390
I know what Java is... but I've never programmed a single line of code in it. Can Java be run as a simple terminal window?
All I need to do is generate 3 numbers (whose equations I already know) and have the user input a 4th number. Then a small text file will be generated with the results.
The numbers are all integers.
You most certainly can run a java application in a terminal window. Considering what you're trying to do, you shouldn't need to worry about any external dependencies, so the program should be fully portable. The only concern would be creating the results text file in a specific directory, since directories are structured differently in Mac, Windows, and Linux. However, Java also has a built-in function to check what operating system is running it, and you can use a simple if/else statement to set the default directory.

I'd offer to write it for you but I'm going camping this weekend and will not be back at a computer until Monday.
 

tshuck

Joined Oct 18, 2012
3,534
You most certainly can run a java application in a terminal window. Considering what you're trying to do, you shouldn't need to worry about any external dependencies, so the program should be fully portable. The only concern would be creating the results text file in a specific directory, since directories are structured differently in Mac, Windows, and Linux. However, Java also has a built-in function to check what operating system is running it, and you can use a simple if/else statement to select the default directory.

I'd offer to write it for you but I'm going camping this weekend and will not be back at a computer until Monday.
This has a dependency on having the Java Runtime Environment (JRE) on the computer.

The odds of having the JRE installed in a computer is certainly less than having the .NET framework installed on a Windows machine.
 

DerStrom8

Joined Feb 20, 2011
2,390
This has a dependency on having the Java Runtime Environment (JRE) on the computer.

The odds of having the JRE installed in a computer is certainly less than having the .NET framework installed on a Windows machine.
Ah, I see what you mean. After working in Java for 3 years my definition of "dependency" is not exactly the same as yours :p

I actually think you have a higher chance of having a JRE installed than .NET. Based on past experience, I gather that Java is used more than twice as much as .NET is, plus its cross-platform compatibility makes it a much better candidate for a wide variety of applications. As long as you don't mind having a lot of built-in libraries you don't need, it is really the best option in my opinion.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,212
You most certainly can run a java application in a terminal window. Considering what you're trying to do, you shouldn't need to worry about any external dependencies, so the program should be fully portable. The only concern would be creating the results text file in a specific directory, since directories are structured differently in Mac, Windows, and Linux. However, Java also has a built-in function to check what operating system is running it, and you can use a simple if/else statement to set the default directory.

I'd offer to write it for you but I'm going camping this weekend and will not be back at a computer until Monday.
Thanks for your very generous offer. I'll seriously consider waiting until monday for your help. It's an extremely easy program, but I'm completely unfamiliar with Java.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,212
Ah, I see what you mean. After working in Java for 3 years my definition of "dependency" is not exactly the same as yours :p

I actually think you have a higher chance of having a JRE installed than .NET. Based on past experience, I gather that Java is used more than twice as much as .NET is, plus its cross-platform compatibility makes it a much better candidate for a wide variety of applications. As long as you don't mind having a lot of built-in libraries you don't need, it is really the best option in my opinion.
Also, I'm under the impression that most browsers use java to access certain websites.
 

tshuck

Joined Oct 18, 2012
3,534
Ah, I see what you mean. After working in Java for 3 years my definition of "dependency" is not exactly the same as yours :p

I actually think you have a higher chance of having a JRE installed than .NET. Based on past experience, I gather that Java is used more than twice as much as .NET is, plus its cross-platform compatibility makes it a much better candidate for a wide variety of applications. As long as you don't mind having a lot of built-in libraries you don't need, it is really the best option in my opinion.
In the sense that the OP would understand the phrase dependency, the JRE is a required piece of software for the program to run, not as in a library or external jar file, I should be more specific when talking with a programmer. ;)

I just deployed a Java application I wrote to our group and found half if them did not have a JRE installed, but a .NET application I wrote last year found everyone had .NET 3.5 or higher already, but that may just be my experience.

You can't neglect the Mono project when talking .NET portability. ;)

Yes, I agree Java is probably the better option for future portability, just wanted to point out that a JRE is required software for it to run so cmartinez is aware.
 

DerStrom8

Joined Feb 20, 2011
2,390
Also, I'm under the impression that most browsers use java to access certain websites.
That gets into the realm of Java Server Pages, which are primarily what I was working with in my previous job with ADP. Simply put, JSPs allow the creation of dynamic webpages by manipulating the HTML with the Java language on the server-side computer. Then you have JavaScript, which is somewhat similar to Java but is NOT the same language. JS simply runs alongside HTML or JSPs to change the HTML or run operations on the client-side computer.
 

DerStrom8

Joined Feb 20, 2011
2,390
In the sense that the OP would understand the phrase dependency, the JRE is a required piece of software for the program to run, not as in a library or external jar file, I should be more specific when talking with a programmer. ;)

I just deployed a Java application I wrote to our group and found half if them did not have a JRE installed, but a .NET application I wrote last year found everyone had .NET 3.5 or higher already, but that may just be my experience.

You can't neglect the Mono project when talking .NET. ;)

Yes, I agree Java is probably the better option for future portability, just wanted to point out that a JRE is required software for it to run so cmartinez is aware.
You're right, for a program as simple as this I'm sure .NET would work just fine, but that assumes it will only be used on a PC. I know there are some open source third-party projects out there working to get .NET to run on different platforms, but to my knowledge none of them are all that dependable.

Thanks for clarifying, you're absolutely right--cmartinez would need to ensure a JRE (Jave Runtime Environment) is installed on the computer before running the application.
 
Top