Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

larswik

macrumors 68000
Original poster
Sep 8, 2006
1,552
11
I downloaded this http://sourceforge.net/projects/freepascal/files/Mac OS X/2.2.4/ and it gave me what I needed to run Pascal from within xcode and not the terminal any more. When I write this code
Code:
program test;
begin
writeln('Hello World');
end.
it prints this mess out on the console window
Code:
[Session started at 2011-01-29 13:20:21 -0800.]
Hello World
Heap dump by heaptrc unit
6 memory blocks allocated : 999/1016
6 memory blocks freed     : 999/1016
0 unfreed memory blocks : 0
True heap size : 360448 (96 used in System startup)
True free heap : 360352

The Debugger has exited with status 0.

At this point I should just count my blessings and be happy I can do everything in xcode but I will ask any way:) Is there a preference setting for removing all the extra memory data that gets printed so I can just see hello world and that it exited out ok?

Thanks!

-Lars
 
Thanks for the Manual Lee!

All of my coding has been with xcode and I am comfortable with it. I am not opposed to using the Terminal in the future but tight now Pascal will be new to me and the Terminal to compile and run will be new to me. I would rather stick with something I know right now. Plus it is much easier to make changes in xcode, save and run it right there with in seconds.

-Lars
 
The user's guide:
http://www.unlu.edu.ar/~program1/biblioteca/freepascal/user.pdf

says -gh when compiling enables that output. You'll need to find the compiler flags being used and take that one out.

Why are you abandoning the terminal? Will every machine you ever intend to program on have XCode available?

-Lee
Call me old-fashioned because in many ways, I am old-fashioned. Since I've always been that way, I've always preferred a command-line to a graphic user interface, partly because a graphic user interface often slows my work. If I need to, say, empty a folder, I don't drag files one by one to the trash can. I open a terminal window, go into that folder, and type, "rm -rf *". Or if I already know the path to that folder, I can skip the "cd" step and just type something like this, "rm -rf /Users/Bill/Backup/*". Maybe from now on, I'll always keep a terminal window open.
 
Last edited:
If I need to, say, empty a folder, I don't drag files one by one yo the trash can.

I'm old fashioned too and always have Terminal open when writing code, but that's not a great example. It's fairly easy to select and delete all files and subfoldrs in a folder in the GUI as well.

FWIW check out Path Finder, it supports many extensions to Finder that are aimed at old-fashioned types like us.

larswik: I'm glad you got Xcode to work. Have you checked if debug features are working like breakpoints, variable inspectors, ...

B
 
I would rather stick with something I know right now.
Fair enough.

Plus it is much easier to make changes in xcode, save and run it right there with in seconds.

-Lars

Typing :w :! and up arrow to bring up the last command which compiles and runs my code is pretty fast. The seven keystrokes necessary take well under a second. I say this to demonstrate that the terminal need not be slow. I feel like touching the mouse is a huge speedbump. I know IDEs have keyboard shortcuts, but a lot of the interaction seems mouse driven.

To each his own, but I don't count on an IDE being available (or any GUI interaction at all) when I need to write code.

-Lee
 
larswik: I'm glad you got Xcode to work. Have you checked if debug features are working like breakpoints, variable inspectors, ...
B

No, not yet, I am searching the web trying to find out how to shut off the Flags in the compiler so it won't list the Heap information when it finishes displaying the output. Lee gave me a lead and now I am trying to find out if it is some code that I add to my program to shut it off or if it is something I need to do with the Terminal (old school style :) ) to set it up once and then forget about it.

-Lars
 
No, not yet, I am searching the web trying to find out how to shut off the Flags in the compiler so it won't list the Heap information when it finishes displaying the output. Lee gave me a lead and now I am trying to find out if it is some code that I add to my program to shut it off or if it is something I need to do with the Terminal (old school style :) ) to set it up once and then forget about it.

-Lars

It should be in your build settings. It didn't sound like this was on by default, so it may be in the default build settings.

-Lee
 
Typing :w :! and up arrow to bring up the last command which compiles and runs my code is pretty fast. The seven keystrokes necessary take well under a second. I say this to demonstrate that the terminal need not be slow.

And in Terminal.app, the up arrow brings up the last command line. Press it again and it brings up the second last command. Press RETURN and it runs that command.

Or my usual approach is to edit command-lines in a TextEdit plain text window, then drag-and-drop to Terminal window. This is especially useful if it's a command longer than about a dozen characters. Example:
Code:
curl -s http://example.com/somethingToGet
Oh wait, I wanted to see the headers. Go to TextEdit window, add the -v option, select and drag:
Code:
curl -s -v http://example.com/somethingToGet
 
Maybe from now on, I'll always keep a terminal window open.

First thing I do when setting up an OS X machine is to add the Terminal to my account Login Items so it's always there on startup.

Somewhere in a box, I still have my Apple II Pascal floppy disks, with some programs I wrote way back. But it would be a long journey to get any Pascal programs on those disks into my MacBook.
 
I'm old fashioned too and always have Terminal open when writing code, but that's not a great example. It's fairly easy to select and delete all files and subfoldrs in a folder in the GUI as well.
You're right, B. That's not a great example. So I like to startle some GUI fans with "1,$d" when the file I'm editing is at least 1,000 lines long. :)

Thanks for the tip. I'll do that. I need to learn a lot about OS X because I'm much more familiar with Solaris.
FWIW check out Path Finder, it supports many extensions to Finder that are aimed at old-fashioned types like us.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.