VOGONS

Common searches


Running my own program.

Topic actions

First post, by nicewander

User metadata
Rank Newbie
Rank
Newbie

Hello,

I ask your indulgence as I am almost 70 years old and not very computer literate but I can learn.

I am trying to run a program I wrote using Pascal years ago but I get the message "This program requires Windows." What must I do to get it to run? Or if you know how I can easily convert my program to run with Windows 7 (without having to write code) or where I can find that information I would appreciate that information.

Thank you.

Bob

Reply 1 of 31, by retro games 100

User metadata
Rank l33t
Rank
l33t

I wonder if the message is referring to Windows 3? If it is, then you could install an old copy of Windows 3 (still available on places like ebay) on to your current machine (you'll need a floppy disk drive), using the free to download DOSBox emulator, and then try running your Pascal program.

Edit: BTW, you can get USB 3.5" floppy disk drives.

Reply 2 of 31, by nicewander

User metadata
Rank Newbie
Rank
Newbie
nicewander wrote:

I am trying to run a program I wrote using Pascal years ago but I get the message "This program requires Windows."

Here is a screenshot of output from the program. The directions show on the screen and wait for input then the next request comes up after enter is clicked.

y-uniput.gif

Bob

Reply 3 of 31, by nicewander

User metadata
Rank Newbie
Rank
Newbie
retro games 100 wrote:

I wonder if the message is referring to Windows 3? If it is, then you could install an old copy of Windows 3 (still available on places like ebay) on to your current machine (you'll need a floppy disk drive), using the free to download DOSBox emulator, and then try running your Pascal program.

Edit: BTW, you can get USB 3.5" floppy disk drives.

Thank you for your answer.

I wrote the program in 1999 but now have an Acer Aspire with Windows 7 and a DVD drive. I really don't know about programing. Just bought a book about learning Pascal in 3 days and followed the instruction to write my program.

Bob

Reply 4 of 31, by retro games 100

User metadata
Rank l33t
Rank
l33t
nicewander wrote:

I wrote the program in 1999 but now have an Acer Aspire with Windows 7 and a DVD drive. I really don't know about programing. Just bought a book about learning Pascal in 3 days and followed the instruction to write my program.

Can you tell me what version of Pascal you used, or the name of the Pascal programming book? When you wrote this Pascal program, did you launch the compiler from inside DOS (eg version 5 or 6 or ?), or from Windows 3?

Reply 5 of 31, by nicewander

User metadata
Rank Newbie
Rank
Newbie

Sorry for the delay in responding. My ISP acted up. The diskette has a label with

"Learn Pascal in Three Days (2nd Ed)
Companion Diskette
1997 Wordware Publishing, Inc.
2320 Los Rios Blvd Plano, Texas 75074"

on it. Book name is the same first line with Sam Abolrous (author) also.

Just found old files. Turbo Pascal 4.0 created Dec 16, 1987.

Started program and wrote programs in DOS window.

Bob

Reply 6 of 31, by retro games 100

User metadata
Rank l33t
Rank
l33t

I visited a couple of Wikipedia pages, to try and understand the timeline involved here. I went to -

http://en.wikipedia.org/wiki/Turbo_Pascal#Later_versions , to look at the release dates for Turbo Pascal, and also this site -

http://en.wikipedia.org/wiki/Microsoft_Window … #Early_versions , to look at the release dates for early versions of Windows.

Windows 2 was released at the same time as Turbo Pascal 4. I reckon it's possible your program needs Windows 2. I'm guessing it would also work if you ran it using the easier to find on ebay Windows 3, or version 3.11. I think that my original response (above) to this situation is something you might like to consider. Good luck! 😀

Reply 7 of 31, by Davros

User metadata
Rank l33t
Rank
l33t

I used to use turbo pascal 4 and it was pure dos so i dont understand why it saying needs windows (maybe the error msg is wrong)
can you post the contents of your uses line
eg:
uses crt;
pps: any chance of posting your program
perhaps someone can test it in dosbox

Guardian of the Sacred Five Terabyte's of Gaming Goodness

Reply 8 of 31, by nicewander

User metadata
Rank Newbie
Rank
Newbie

Thanks Retro.

Davros, I might have a txt file of my programs (or 1 of them) on a CD, but it will take some days to find unless I get lucky. Will post the file when I find it. Don't understand about the uses line.

Thanks,

Bob

Reply 9 of 31, by Davros

User metadata
Rank l33t
Rank
l33t

units are a library of standard functions you can use in your program (bit like how windows programs use dll files for things like scrollbars)
there are about a dozen of these files and they end with a tpu extension eg: crt.tpu
you have to tell the compiler to look in them for functions or procedures that are in your program

example

* crt Implements writing to the console in color, moving the text cursor around and reading from the keyboard
*it contains functions like clrscr (clears the screen) do you really want to have to write some code that puts the cursor to the top left of the screen writes 80 spaces moves down to the beginining of the next line does that 25 times then move back to the top left of screen every time you want to clear the screen answer no you dont;) you would rather just put the line clrscr; in your program

clrscr;
clears the screen compiler looks in your code for a procedure called clrscr when it cant find it it looks in crt.tpu for it because
you told the compiler to do so by adding it to the uses line
eg: uses crt;

example

program myprogram;
uses crt;

begin
clrscr;
writeln ('hello')
end.

Guardian of the Sacred Five Terabyte's of Gaming Goodness

Reply 10 of 31, by nicewander

User metadata
Rank Newbie
Rank
Newbie

Her is one of my programs. It is the one I would like to get to run on newer versions of Windows. It ran on whatever version preceded Vista.

I see it did not paste the way it looks in the file with indents and staggering.

Bob

program SOLARPROGA(input,output);

var
sr2mnth,sr2dte,sr2yr,sr2h,sr2m,sr2s,ramc2h,ramc2m,ramc2s,sr1mnth,sr1dte,
sr1yr,sr1h,sr1m,sr1s,ramc1h,ramc1m,ramc1s,lngthdte,lngthh,lngthm,lngths,
lngthramch,lngthramcm,lngthramcs,addh,addm,adds,ps,pm,ph,psr1dte,rarsnd,rarsnm,
ratsnd,ratsnm,ramh,ramm,rams,pramh,pramm,prams,addqh,addqm,addqs,
pqs,pqm,pqh,qramh,qramm,qrams,qprams,qpramm,qpramh,pssrd,pssrm,qd,qpm,
qpsr1dte,qpsr1mnth,qpsr1yr:integer;

part1,part2,key,part3,part4,secret,parta,partb,partc,partd,parte,partg,
gm,gs,ramf,ramf1,partq1,partq2,partq3,qm,qs,qramf,qramf1,qramc,qwork,
pssrramc,work:real;

a,a1,b,b1:boolean;

begin;

writeln('When entering data use spaces as separators.');
writeln('After all data is entered for each instruction press enter.');
writeln('Answers for time of progressed chart are in military time.');
writeln('If hours exceed 12 subtract 12 hours from the answer to get PM time.');
writeln('To exit program at anytime press Ctrl + c.');
writeln;
writeln('TO COMPUTE PRECISION PROGRESSED SOLAR RETURN:');
writeln;
writeln('Enter date of Solar Return after event in format mm dd yyyy.');
writeln('Use a space between month and date and between the date and year.');
readln(sr2mnth, sr2dte, sr2yr);
writeln;
writeln('Enter time of Solar Return after event in format hh mm ss.');
writeln('Enter hours in military time. ie add 12 hrs to pm times.');
writeln('Use a space between hours and minutes and between minutes and seconds.');
readln(sr2h, sr2m, sr2s);
writeln;
writeln('Enter Local Sidereal Time of Solar Return after event in format hh mm ss.');
writeln('As above use spaces instead of colons.');
readln(ramc2h, ramc2m, ramc2s);
writeln;
writeln('Enter Right Ascension of Solar Return Sun in format ddd mm.');
writeln('Use a space between degrees and minutes. No symbols are necessary.');
readln(rarsnd, rarsnm);
writeln;
parta := (rarsnm/60)+rarsnd;
writeln('Enter date of Solar Return before event in format mm dd yyyy.');
writeln('Use a space between the month and date and between the date and year.');
readln(sr1mnth, sr1dte, sr1yr);
writeln;
writeln('Enter time of Solar Return before event in format hh mm ss.');
writeln('Enter hours in military time. ie add 12 hrs to PM times.');
writeln('Again use spaces instead of colons.');
readln(sr1h, sr1m, sr1s);
writeln;
writeln('Enter Local Sidereal Time of Solar Return before event in format hh mm ss.');
writeln('Again use spaces instead of colons.');
readln(ramc1h, ramc1m, ramc1s);
writeln;
if sr2s < sr1s then
begin
sr2m := sr2m - 1;
sr2s := sr2s + 60;
end;

if sr2m < sr1m then
begin
sr2h:= sr2h - 1;
sr2m:= sr2m + 60;
end;

if sr2h < sr1h then
begin
sr2h := sr2h + 24;
sr2dte := sr2dte - 1;
end;
IF SR2DTE = SR1DTE THEN
BEGIN;
SR1MNTH := SR1MNTH
END;
IF SR2DTE > SR1DTE THEN
BEGIN;
SR2DTE := SR2DTE - 1;
END;
if sr2dte < sr1dte then
begin

case sr2mnth of

1,2,4,6,8,9,11 : sr2dte := sr2dte + 31;

5,7,10,12 : sr2dte := sr2dte + 30;

3 :
begin;
if (sr2yr mod 4 = 0) then
sr2dte := sr2dte + 29

else

sr2dte := sr2dte + 28;

end;
end;
end;

lngthdte := sr1dte - sr1dte; (*correct for lunars is lr2dte-lr1dte*)
lngthh := sr2h - sr1h;
lngthm := sr2m - sr1m;
lngths := sr2s - sr1s;

if ramc2s < ramc1s then
begin
ramc2m := ramc2m - 1;
ramc2s := ramc2s + 60;
end;

if ramc2m < ramc1m then
begin
ramc2h:= ramc2h - 1;
ramc2m:= ramc2m + 60;
end;

if ramc2h < ramc1h then
begin
ramc2h := ramc2h + 24;
end;

lngthramcs := ramc2s - ramc1s;
lngthramcm := ramc2m - ramc1m;
lngthramch := (ramc2h - ramc1h)+24;

part1 := (((lngthramcs/60)+lngthramcm)/60)+lngthramch;
writeln('Enter Right Ascension of transiting Sun in format ddd mm.');
writeln('Use a space between degrees and minutes. No symbols are necessary.');
readln(ratsnd, ratsnm);
writeln;
partb := (ratsnm/60)+ratsnd;

if partb < parta then
begin
partb := partb + 360;
end;

partc := partb-parta;

partd := partc/360;

secret := 0.9972620833;

parte := part1*partd;

partg := parte*secret;

addh := trunc(partg);
gm := frac(partg);
addm := trunc(gm*60);
gs := frac(gm*60);
adds := trunc(gs*60);

ps := adds+sr1s;
pm := addm+sr1m;
ph := addh+sr1h;
a := (ph>=24) and (ph<=48);
a1 := (ph>=24) and (ph>=48);

if ps>=60 then
begin
ps :=ps-60;
pm :=pm+1;
end;
if pm>=60 then
begin
pm :=pm-60;
ph :=ph+1;
end;

if PH>=48 then
begin
ph := ph-48;
sr1dte := sr1dte+2;
end;
if ph>=24 then
begin
ph := ph-24;
sr1dte :=sr1dte+1;
end;
(*if ph>48 then
begin
ph := ph-48;
sr1dte := 2+sr1dte;
end;*)

if sr2dte = sr1dte then
begin;
sr1mnth := sr1mnth
end;
if sr2dte < sr1dte then
begin;
case sr1mnth of
1,3,5,7,8,10,12 :
begin;
if sr1dte >= 32 then
sr1dte := sr1dte-31;
if sr1dte >= 32 then
sr1mnth := sr1mnth+1;
end;
4,6,9,11 :
begin;
if sr1dte = 31 then
sr1dte := sr1dte-30;
if sr1dte = 31 then
sr1mnth := sr1mnth+1;
end;
2 :
begin;
if (sr1yr mod 4 = 0) then
if sr1dte = 30 then
begin
sr1dte := sr1dte-29;
end

else
sr1dte := sr1dte-28;
(* sr1mnth := sr1mnth+1;CHANGED 1-13*)
end;
end;
end;
writeln('A CHART DONE FOR THIS DATE AND TIME WILL BE THE PPS.');
writeln;
writeln('Date and time of PPS = ',sr1mnth,'/',sr1dte,'/',sr1yr,' @ ',
ph,':',pm,':',ps);

ramh := trunc(parte);
ramf := frac(parte);
ramm := trunc(ramf*60);
ramf1 := frac(ramf*60);
rams := trunc(ramf1*60);

prams := rams+ramc1s;
pramm := ramm+ramc1m;
pramh := ramh+ramc1h;

if prams>=60 then
begin
prams :=prams-60;
pramm :=pramm+1;
end;
if pramm>=60 then
begin
pramm :=pramm-60;
pramh :=pramh+1;
end;
if pramh>=48 then
begin
pramh := pramh-48;
end;
if pramh>=24 then
begin
pramh := pramh-24;
end;

pssrramc := ((((prams/60)+pramm)/60)+pramh)*15;
pssrd := trunc(pssrramc);
work := frac(pssrramc);
pssrm := trunc(work*60);
write('LST of PPS is ',pramh,':',pramm,':',prams);
writeln(' PPS LST in Degrees and Minutes is ',pssrd,' ',pssrm);
writeln;
writeln('COMPUTATION OF PRECISION PROGRESSED SOLAR RETURN IS FINISHED.');
writeln;
writeln;
writeln('TO COMPUTE QUOTIDIAN PROGRESSED SOLAR RETURN:');
writeln;
writeln('Enter date of Solar Return before event in format mm dd yyy.');
writeln('Use a space between the month and date and between date and year.');
readln(qpsr1mnth,qpsr1dte,qpsr1yr);
writeln;
partq1 := partc/15;

partq2 := part1*partq1;

partq3 := partq1*secret;

addqh := trunc(partq3);
qm := frac(partq3);
addqm := trunc(qm*60);
qs := frac(qm*60);
addqs := trunc(qs*60);

pqs := addqs+sr1s;
pqm := addqm+sr1m;
pqh := addqh+sr1h;
b := (pqh>=24) and (pqh<=48);
b1 := (pqh>=24) and (pqh>=48);

if pqs>=60 then
begin
pqs :=pqs-60;
pqm :=pqm+1;
end;
if pqm>=60 then
begin
pqm :=pqm-60;
pqh :=pqh+1;
end;
if pqh<=24 then
begin
qpsr1dte :=qpsr1dte;
end;
if b1 then
begin
pqh := pqh-48;
qpsr1dte := qpsr1dte+2;
end;
IF PQH>=24 THEN (*if b then*CHANGED 1-13*)
begin
pqh := pqh-24;
qpsr1dte := qpsr1dte+1;
end;
if pqh>=48 then
begin
pqh := pqh-48;
qpsr1dte := 2+qpsr1dte;
end;
if sr2dte < sr1dte then
begin
case qpsr1mnth of
1,3,5,7,8,10,12 :
begin;
if qpsr1dte = 32 then
qpsr1dte := qpsr1dte-31;
if qpsr1dte = 32 then
qpsr1mnth := qpsr1mnth+1;
end;
4,6,9,11 :
begin;
if qpsr1dte = 31 then
qpsr1dte := qpsr1dte-30;
if qpsr1dte = 31 then
qpsr1mnth := qpsr1mnth+1;
end;
2 :
begin;
if (qpsr1yr mod 4 = 0) then
if qpsr1dte = 30 then
begin
qpsr1dte := qpsr1dte-29;
end

else
qpsr1dte := qpsr1dte-28;
(* qpsr1mnth := qpsr1mnth+1;CHANGED 1-13*)
end;
end;
end;
writeln('A CHART DONE FOR THIS DATE AND TIME WILL BE THE QPS.');
writeln;
writeln('Date and time of QPS is ',qpsr1mnth,'/',qpsr1dte,'/',qpsr1yr,' @ ',pqh,':',
pqm,':',pqs);

qramh := trunc(partq1);
qramf := frac(partq1);
qramm := trunc(qramf*60);
qramf1 := frac(qramf*60);
qrams := trunc(qramf1*60);

qprams := qrams+ramc1s;
qpramm := qramm+ramc1m;
qpramh := qramh+ramc1h;

if qprams>=60 then
begin
qprams :=qprams-60;
qpramm :=qpramm+1;
end;
if qpramm>=60 then
begin
qpramm :=qpramm-60;
qpramh :=qpramh+1;
end;
if qpramh>=48 then
begin
qpramh := qpramh-48;
end;
if qpramh>=24 then
begin
qpramh := qpramh-24;
end;

qramc := ((((qprams/60)+qpramm)/60)+qpramh)*15;
qd := trunc(qramc);
qwork := frac(qramc);
qpm := trunc(qwork*60);
write('LST of QPS is ',qpramh,':',qpramm,':',qprams);
writeln(' QPS LST in Degrees and Minutes is ',qd,' ',qpm);
writeln;
writeln('COMPUTATION OF THE QUOTIDIAN PROGRESSED SOLAR RETURN IS FINISHED.');
writeln('To run again press F3.');
writeln;
writeln('Copyright 1993-2001 by Robert Nicewander');

end.

Last edited by nicewander on 2010-10-12, 08:45. Edited 1 time in total.

Reply 12 of 31, by nicewander

User metadata
Rank Newbie
Rank
Newbie

There was a button to click to turn the PAS into an e.x.e file which I did. I have the original PAS file saved but don't know how to post it or upload it so you could try to compile it.

Bob

ETA: Could email it?

Last edited by nicewander on 2010-10-12, 08:17. Edited 1 time in total.

Reply 14 of 31, by retro games 100

User metadata
Rank l33t
Rank
l33t
nicewander wrote:

I have the original PAS file saved but don't know how to post it or upload it so you could try to compile it.

Have you tried the "Browse" then "Add Attachment" buttons, inside the Vogons new post webform? If your attachment won't get uploaded successfully, perhaps you could rename the file for uploading. You could rename it to .TXT
A file with the .TXT extension would be OK to upload to Vogons. Whoever downloads this file can rename it back to the original file extension. I guess that would be .PAS?

Reply 15 of 31, by nicewander

User metadata
Rank Newbie
Rank
Newbie
retro games 100 wrote:

Have you tried the "Browse" then "Add Attachment" buttons, inside the Vogons new post webform? If your attachment won't get uploaded successfully, perhaps you could rename the file for uploading. You could rename it to .TXT
A file with the .TXT extension would be OK to upload to Vogons. Whoever downloads this file can rename it back to the original file extension. I guess that would be .PAS?

Thanks for the help retro. Will try to attach original to this post. Will rename it as you suggest if it won't attach as a PAS FILE.

Bob

Attachments

  • Filename
    SOLAR.TXT
    File size
    13.02 KiB
    Downloads
    296 downloads
    File license
    Fair use/fair dealing exception

Reply 16 of 31, by eL_PuSHeR

User metadata
Rank l33t++
Rank
l33t++

Here it is the compiled EXE using Turbo Pascal 7.

It works perfectly under the Windows XP NTVDM (cmd.exe) and it should work under Windows 7 too.

It works using DOSBox 0.74 too, except for the CTRL-C combination to exit (use CTRL-F9 instead).

Attachments

  • Filename
    SOLAR.ZIP
    File size
    6.64 KiB
    Downloads
    293 downloads
    File comment
    Solar Program (compiled with Turbo Pascal 7)
    File license
    Fair use/fair dealing exception

Reply 18 of 31, by keropi

User metadata
Rank l33t++
Rank
l33t++

I can confirm eL_PuSHeR 's compile works fine on win7pro/32bit 😀

🎵 🎧 PCMIDI MPU , OrpheusII , Action Rewind , Megacard and 🎶GoldLib soundcard website

Reply 19 of 31, by Davros

User metadata
Rank l33t
Rank
l33t

My god if i was your teacher and you handed that in as an assignment I would beat you to death with a rubber chicken 😁

why ?
1: comment you work
2: break it up into procedures
3: use meaningful variable names

Guardian of the Sacred Five Terabyte's of Gaming Goodness