Link to home
Start Free TrialLog in
Avatar of M S
M S

asked on

Setting up Pascal on Windows

I have a need to write some Pascal programs, after several decades' hiatus.  I downloaded a free version of Pascal from www.freepascal.org.  I also found https://www.freepascal.org/docs-html/current/user/user.html#userch2.html.  

My helloworld program is working nicely, but it was stored to an awkward location: C:\FPC\3.0.4\bin\i386-win32.  Is it possible to save my files to a subdirectory?

When I start the program, I get a very old-fashioned kind of window.  I can't figure out how to close a program after I've saved it (except for killing Pascal entirely).

I would rather use notepad++ for editing my programs.

There is mention of Lazarus but I don't have any experience with that.  I have downloaded and installed it but am not sure what to do next with it.
ASKER CERTIFIED SOLUTION
Avatar of Joe Winograd
Joe Winograd
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i am wondering if Joe and the author are talking about the same Pascal product. obviously Joe's screenshots indicate he is referring to Turbo Pascal from Borland (is it still alive?).
Hi bbao,
Nope! We're talking about the same product, Free Pascal. What's confusing you is that the path to the source file is in a folder called J:\Turbo\TURBOFIL where I stored all my Borland Turbo Pascal programs from yesteryear. It is not still alive, which is why I switched to Free Pascal. However, in recent years, I've rewritten all my important Turbo Pascal programs in AutoHotkey. Regards, Joe
Avatar of M S
M S

ASKER

Thank you, Joe.  I'm making good progress.  Not sure if I need to write a new question for this: I would like to set the .pas files to open with notepad++.  However, there is no "open with" in the context menu, and .pas doesn't appear in the default list.  (For now I've been opening notepad++ and using the Open feature.)

I remembered that to run the program I can double-click on the executable (after the program has compiled).  Within Windows Explorer, that is.

Should I write a separate question about Lazarus?

I
> there is no "open with" in the context menu

I  can't imagine why there wouldn't be an "Open with..." when you right-click on a .PAS file in whatever file manager you use. I get one here and, in fact, I've done the same thing that you want to do...I associated .PAS with my fav text editor. But if you're not getting the "Open with..." in your file manager, try this alternate way:

Control Panel
Default Programs
Associate a file type or protocol with a program

Btw, as an ex-Pascal programmer myself, I switched to writing my programs in AutoHotkey, as I mentioned above, and have never looked back. You may want to give it a spin. This EE article will get you started on it:

AutoHotkey - Getting Started

Yes, you should open a separate question for Lazarus. Regards, Joe
Avatar of M S

ASKER

It is weird.  I tried the Windows->Start method as well.  But .pas didn't appear in the list.
Post a screen shot of the context menu when you right-click on a . PAS file. Since W7 is one of the Topics for this question, I presume you're using Windows Explorer as your file manager, but if not, let me know what file manager you're using. Oh, one other idea. Right-click on a .PAS file and click Properties. You should see an "Opens with:" item. Click the "Change..." button next to it.

Btw, the AutoHotkey language that I mentioned above can very likely help you with your automation of tedious web queries question. Regards, Joe
Avatar of M S

ASKER

Yes, Windows Explorer.  I was able to do Open With now.  I had the bright idea of CLOSING PASCAL and then trying again.  I should have thought of this before....

I found a tutorial about getting started with Lazarus at schoolfreeware.com.  I'm thinking Lazarus might be more than I need.  I'm just going to be doing text processing.

How do you go about debugging Free Pascal?
> I had the bright idea of CLOSING PASCAL and then trying again.

Well, I can't imagine that would affect the file extensions shown in the context menu or in Control Panel>Default Programs>Associate a file type or protocol with a program.

> I'm just going to be doing text processing.

I suspect NPP will be fine for you.

> How do you go about debugging Free Pascal?

I suggest a new question for that. This question is "Setting up Pascal on Windows". Now that it is set up on Windows, this question is answered. Coding/debugging with it is a big subject and worthy of a new question...or questions. Regards, Joe
thanks for your clarification and further information Joe.
You're welcome, bbao...happy to help. Regards, Joe