Pascal in TextWrangler

1,107 views
Skip to first unread message

goose

unread,
Nov 26, 2010, 1:11:47 AM11/26/10
to TextWrangler Talk
I have TextWrangler version 3.1. I'm trying to write in pascal but
whenever I try to run it, I'm told, "The unix tool referenced in the
‘shebang’ line cannot be found (application error code: 13305)"
After researching this I have determined that I need to add #!/usr/
bin/
(something). I also know that the (something) is somehow related to
pascal, or something. However, I don't know the official (something)
that needs to be put there.
Please tell me what I should add, or if I'm horribly wrong and I need
to do something else. Here is my code (It's just to test to see if my
mac could do pascal in TextWrangler):
#!/usr/bin/(something)
Program Checking;
Begin
writeln('This program is working!');
readln;
end.

Jean-Christophe Helary

unread,
Nov 26, 2010, 11:27:32 AM11/26/10
to textwr...@googlegroups.com
Do you have pascal installed on your machine ?

Pascal is not installed by default on OSX, so you'll need to install it from either Fink, of Macport, or anything else that you see fit.

When it is installed, you need to know its path to use it in TextWrangler.

If it is installed from Fink, the path is likely to be something like /sw/bin/..., if it is installed from Macports it should be /usr/local/bin/...

As for the pascal available, you have:
http://www.freepascal.org/
http://www.microbizz.nl/gpc.html

etc.


Jean-Christophe Helary
----------------------------------------
fun: http://mac4translators.blogspot.com
work: http://www.doublet.jp (ja/en > fr)
tweets: http://twitter.com/brandelune

goose

unread,
Nov 26, 2010, 4:38:11 PM11/26/10
to TextWrangler Talk
Thank you so much. So I downloaded pascal from freepascal.org. I
installed it, then went into the file where there were two things to
be installed, free pascal (fpc-2.4.0.intel-macosx.pkg) and an xcode
thing (fpc-xcode-2.4.0.pkg). I opened those packages to install.
Everything went smothly until I got to the "Select a Destination"
step. It wouldn't allow me to install it on my hard drive. It
displayed a message that I didn't totally understand:

(fpc-xcode-2.4.0.pkg message:)
FPC Xcode templates can't be installed on this disk. These are
templates for use with Apple's Xcode IDE, which is installed together
with the rest of Apple's developer tools. Please install the Xcode
developer tools from your installation DVD or from https://connect.apple.com
and then try again. Ensure that you keep the "Support for UNIX
development" option checked in its installer.

(fpc-2.4.0.intel-masox.pkg message:)
Free Pascal Compiler can't be installed on this disk. You have to
install the Mac OS X developer tools (Xcode) before installing this
package. When Installing Xcode 3.x, make sure to install support for
Unix development it's installed dby default, but you can uncheck it).

Thank you, again, for helping me. I'm starting to feel a little above
my head, but I'm determined to get pascal! Haha :)

On Nov 26, 8:27 am, Jean-Christophe Helary
<jean.christophe.hel...@gmail.com> wrote:
> Do you have pascal installed on your machine ?
>
> Pascal is not installed by default on OSX, so you'll need to install it from either Fink, of Macport, or anything else that you see fit.
>
> When it is installed, you need to know its path to use it in TextWrangler.
>
> If it is installed from Fink, the path is likely to be something like /sw/bin/..., if it is installed from Macports it should be /usr/local/bin/...
>
> As for the pascal available, you have:http://www.freepascal.org/http://www.microbizz.nl/gpc.html

Spencer

unread,
Dec 4, 2010, 4:03:05 PM12/4/10
to TextWrangler Talk
As it says, you need to install XCode and the other developer tools.
This installs gcc and a bunch of libraries that are used by Pascal,
although it doesn't install pascal itself.
Just follow the link to https://connect.apple.com, and login with your
apple account (free). The download you want is under 'Developer Tools'
on the right side, and the actual package you want to get is called
'Xcode 3.2.2 Developer Tools.' It's rather big, but will be required
for any programming you do in the future, not just pascal.

-Spencer


On Nov 26, 1:38 pm, goose <kate9m...@comcast.net> wrote:
> Thank you so much. So I downloaded pascal from freepascal.org. I
> installed it, then went into the file where there were two things to
> be installed, free pascal (fpc-2.4.0.intel-macosx.pkg) and an xcode
> thing (fpc-xcode-2.4.0.pkg). I opened those packages to install.
> Everything went smothly until I got to the "Select a Destination"
> step. It wouldn't allow me to install it on my hard drive. It
> displayed a message that I didn't totally understand:
>
> (fpc-xcode-2.4.0.pkg message:)
> FPC Xcode templates can't be installed on this disk. These are
> templates for use with Apple's Xcode IDE, which is installed together
> with the rest of Apple's developer tools. Please install the Xcode
> developer tools from your installation DVD or fromhttps://connect.apple.com

Katie

unread,
Jan 13, 2011, 6:58:56 PM1/13/11
to textwr...@googlegroups.com
Okay, so I have the XCode installed and the package from freepascal.org. I still get the message saying, "This file doesn’t appear to contain a valid ‘shebang’ line (application error code: 13304)". 
What now?

--
You received this message because you are subscribed to the
"TextWrangler Talk" discussion group on Google Groups.
To post to this group, send email to textwr...@googlegroups.com
To unsubscribe from this group, send email to
textwrangler...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/textwrangler?hl=en
If you have a feature request or would like to report a problem,
please email "sup...@barebones.com" rather than posting to the group.

Spencer

unread,
Jan 14, 2011, 7:34:07 PM1/14/11
to textwr...@googlegroups.com
Goose,

I think there's some confusion here about what TextWrangler is capable of. I'm going to spell out some basics here, and I hope it clarifies things. I'm going to assume you don't have any experience at all with running programs from a command line (eg unix, dos, etc).
  • TextWrangler is a text editor. It writes very simple text files, which could be opened and edited by TextEdit or Notepad, etc.
  • Unix has the concept of a script. This is a text file which is used as input to a program. The name of the program is given as the first line of the file, starting with #!/path/to/program. For historical reasons the '#!' characters are often pronounced 'shebang'. When unix tries to run such a script, it reads that first line and calls the proper program, with the script as an argument. For example, if we have a script like
#!/bin/sh
echo  "hello world"
then unix knows to call the shell (/bin/sh) to interpret our script
  • TextWrangler has an '#!' menu which has commands for running scripts. Basically, it just opens Terminal.app (Apple's command line interface, similar to standard unix) and executes the text file, relying on the underlying unix-nature of OS X to do the right thing (eg read the shebang and call the right program)
  • Pascal is a compiled language. To my knowledge, there is not program to which you can provide a text file of pascal code and expect it to run (eg a pascal interpreter).
Does that clear things up? So what you want to do is use TextWrangler to write your pascal code. Then use the pascal interpreter you just installed to compile this code into a program. Then run the program directly from Terminal. I'm sure this is covered in pascal tutorials elsewhere.


 
Reply all
Reply to author
Forward
0 new messages