Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help needed to run Pascal program

77 views
Skip to first unread message

jameshum....@gmail.com

unread,
Jul 20, 2015, 2:44:45 PM7/20/15
to
I am trying to run a program written in Pascal- the source code is at http://www.public.iastate.edu/~swillson/STDMove2.p.
Unfortunately, I know next to nothing about Pascal. I downloaded the free Borland compiler but could not work out how to paste the code into the compiler. Also I was not sure if I needed any additional files to run this programming. Is there anyone who would be willing to explain, in very simple terms, how to do this?

Brian

unread,
Jul 21, 2015, 3:48:35 AM7/21/15
to
On Mon, 20 Jul 2015 11:44:44 -0700 (PDT), jameshum....@gmail.com
wrote:

>I am trying to run a program written in Pascal- the source code is at http://www.public.iastate.edu/~swillson/STDMove2.p.
>Unfortunately, I know next to nothing about Pascal.

It's all right - neither does the person who wrote that source code.
To say the style is atrocious is the understatement of the year. It's
been a LONG time since I saw anybody using labels in a Pascal program.
Of course, IF the code is more than 30 years old, that might be a
little unfair. It looks to me like a port from another language.

>I downloaded the free Borland compiler but could not work out how to paste the code into the compiler. Also I was not sure if I needed any additional files to run this programming. Is there anyone who would be willing to explain, in very simple terms, how to do this?

I'm not sure which of the versions of Borland's Pascal is the free one
(it's been quite a few years since I last used Delphi, let alone
Borland Pascal) but basically paste your code into a file and then
either run the command line version of the compiler and pass the file
as a parameter, or if you have the IDE version of the compiler, then
run that and do a file-open inside the IDE in the standard Windows
fashion. The command to compile it will be in the menus.

You may have more luck with using FreePascal (available from
SourceForge, and it's the latest release, not an antiquated version!).
The documentation is there, but there may be some units used in the
source where you have to search for the equivalents in the FreePascal
RTL. If you download Lazarus as well, then that will give you a decent
IDE for FreePascal programs. You need three files - the FreePascal
compiler, the FreePascal sources and the Lazarus IDE. Plus any
documentation, of course.

Brian.

--
This message has been sent from an invalid address
Replace 'Usenetposting' with my name to reply by e-mail.

dik

unread,
Jul 25, 2015, 5:58:27 PM7/25/15
to
the main problem appears to be that the file STDMove2.p
found on the internet is not end-of-line compatible with
turbo pascal - which requires the carriage-return
line-feed pair used in DOS.

one way to fix this is to load STDMove2.p into WORDPAD and
save it as a DOS text file. in fact, i wrote a small
filter in turbo pascal that corrected line endings and
converted tabs to 3 spaces instead of the usual 8. i named
the result STDMOVE2.PAS

although the program has a long USES line, in fact it
depends on none of these units to compile. i deleted the
USES line.

the program writes results to the screen and echoes them
to a log file. i added an 'assign' statement to name that
log STDMOVE2.OUT

if you type and run in a dosbox:

TPC STDMOVE2.PAS

the resulting executable can be run by typing

STDMOVE2.EXE

if you want to modify the source then perhaps try the IDE:

TURBO STDMOVE2.PAS

or just modify STDMOVE2.PAN in something like NOTEPAD
being careful that whatever editor is used ends lines in a
DOS-like manner.

turbo pascal 5.5 is a wonderful program to take on
problems like the one experimented with here. in the GUI
intense world that exploded after TP5's day - one forgets
how pleasant and effective it is to tackle something
profound with just a tiny first-class command line
compiler that writes so smoothly to the console and disk.

good luck - richard

you can download some results of what i did here:

http://quagga5.fastmail.fm/STDMOVE.ZIP

which contains:

STDMOVE2.PAS - slightly modified and still messy source
STDMOVE2.EXE - compiled executable
TPC.EXE - Turbo Pascal Compiler 5.5
TURBO.EXE - the IDE
TURBO.TPL - the run-time library

0 new messages