473,396 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How do I embed a DOS program to run embedded in html on a web page?

I wrote a program in 1995 that can only be run in DOS. I would like to embed this program in a web page. I'd like several buttons to select options. That's all I want.

The program randomly selects one of the bible's 31,102 verses (King James Version) and displays it. When the user clicks on a button it displays another random verse, and so on.

For a Windows 7 computer I now have DOSbox that will run the program, but I don't know how to integrate it into a web page.

Everything I've done so far is on my web page at,

http://www.stonetabernacle.com/The-Bible.html

Which includes links to DOSbox, a download of the zip file containing the executable, the program code (Borland C++), directions and suggestions for improvements.

Can anyone help me?
Aug 29 '15 #1
3 7402
Luuk
1,047 Expert 1GB
Might I suggest to download a new compiler, and build the code so it will run on Windows (DOS is dead!)

Link to compiler: https://www.visualstudio.com/en-us/d...studio-vs.aspx
(but there might be other compilers out there....)
Aug 29 '15 #2
Luuk
1,047 Expert 1GB
or use:
http://www.sandersweb.net/bible/verse.php
or:
http://www.thywordistrue.com/verse_generator

hmm, some people already thought of that idea, so some code for it should be out there already.....
Aug 29 '15 #3
Hi Jon,
I think it will be impossible to integrate a DOSbox or something in a website. A DOS-box is residing on the PC of the visitor, and browsers don't allow webpages to go into the system of the visitor (only for downloading or uploading of a file): security!!!
Besides, a Windows-only solution is excluding the MAC's/phones/tablets which have other Operating Systems.
But as Luuk's links show: it is possible to have an alternative on a webpage.

Problem with these sites: the sandersweb.net is build with php: the code how it's done is only serverside and for us invisible.
The thywordistrue.com site is driven by a huge multi-purpose javascript-file (181kB, not only for the verse-generator) which is very unreadable...

But I think it can be done with a small javascript of about 2.2kB!
Considering the amount of verses in the text-only version of 4.5MB a webpage with all verses would be very slow. I should advise to split it up in a webpage for each Book, then it will be around 150-250kB for a page/book. The javascript can switch between the books, and a new book will be fast on screen.
= = = = =
"Manual"
If not already done, download and install Notepad++ (https://notepad-plus-plus.org).

Download the next files to a new folder on your PC:
Have a look in your browser at the model-page. The css-stylesheet is already linked (can be changed of course). Also the javascript file for the functionality is linked (can be extended/adapted).
To do: filling the 3 dots with html-code for the content of a book.
How? Here we go.

Copy/paste all verses of for example the book Genesis from your file stonetabernacle.com/files/THEBIBLE.TXT in a new Notepad++ file, and save it as Genesis.txt

Still in Notepad++, uncheck in the menu View the "Word Wrap" option in case it is checked.
Go the Menu Edit>LineOperations>Remove Empty Lines.

After this, go to menu Macro>Start Macro.
  • Insert the cursor in the line of Genesis 1:1, just before the G of Genesis.
  • Type <div> and hit the "End" key on the keybord.
  • Type <p> and hit the "Delete" key on the keyboard.
  • Hit the "End" key again and type </p></div>
  • Hit the right arrow key, so the cursor is just before the G of Genesis 1:2.
  • And go to menu Macro>Stop Recording.
  • Again in Macro, go to "Run a Macro multiple times..." with the option "Run until the end of file".
Just a moment ... Notepad++ is heavy working. When ready, save the file.

If you want the words "God" and "LORD" in a special style, you can use menu Search>Replace. For instance search for God and replace with <span>God</span> (Replace all); the css is setting the style for the span's.
Now open the downloaded model-page file in Notepad++, and save it as "HyperTextMarkupLanguage file" with the name of thebook, here: Genesis.html.

Copy/paste all code of the Genesis.txt instead of the 3 dots in the middle.
Save the file: ready for this one!

Do the same for all other books. ;-)

Then rename the start.txt file in start.html, and the files can be uploaded to your server (all in the same folder):
  • start.html
  • randomverse.css
  • randomverse.js
  • Genesis.html
  • Exodus.html
  • ...
  • Revelation.html

Finished!

= = =
In the demo above I did it for Genesis and Exodus.

Good luck!
_______________
Note 1: The array of books in the start.html script and in the randomverse.js has to be adapted for the books which are ready as html-files. Otherwise there are a lot of Pages Not Found. :-)

Note 2: You can put al files in a downloadable (big) zip-file for visitors who like to consult the generator offline.
Oct 3 '15 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Stefan van Roosmalen | last post by:
Hi there, The first page of my Internet website must be INDEX.HTM. But, if I want to embed some PHP code in this page, I must rename it to INDEX.PHP. Easy, but not simple, because INDEX.PHP...
14
by: Michael Levin | last post by:
I've got the following problem. I'm a biologist and I have a device at work which monitors my frog habitat. The device has a bunch of sensors, and runs an embedded html server with some java...
4
by: JT | last post by:
ok - here is my problem: i have a page that dynamically displays payment info for accounts. since each account differs in the number of rows to display, i loop through my recordset and use the...
7
by: TLMM | last post by:
I have an HTML page which is a newsletter. I want to be able to add it to an email message so I can email it to people. I want it to be in the body of the email, not sent as an attachment. There...
4
by: Pawel | last post by:
Hello All I tried to embed Excel sheet into HTML page by following command: <iframe src="Tmp.XLS" width="100%" height="500"></iframe> and it works, showing Excel sheet inside the page, but...
0
by: Chad | last post by:
I have COM component embedded on html page. It has version 1.0.0.1 (by default). I have converted it in cab file. Code of html is something like: <HTML><HEAD></HEAD><BODY><OBJECT...
1
by: Andrew | last post by:
Hi, I've tried creating a very basic class library. It has one object and one property. The property returns always the same string value. I then use the <OBJECT> tag to embed the dll in my...
6
by: Moist | last post by:
Hi, I have an embedded HTML object as follows (ignore the code tag): <code> <object id="page" data="table.html" type="text/html" .... > </code> I look for the Javascript code (placed in...
6
by: jonathanztaub | last post by:
I have a DVD CD. * Is it possible to embed it within an html page? * Does the user has to have windows media player or any other program associated with it? * How exactly do I use the <embed>...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.