Irie Pascal FAQ

Frequently Asked Questions (FAQ)

Below is a list of some of the questions frequently asked about Irie Pascal.

Question. Why does Irie Pascal keep printing hello world?

Answer. By default, when you start the Irie Pascal Integrated Development Environment (IDE), the first thing it does is open the default project which normally contains a program that prints "hello world". Even if you create a new program, the IDE will continue to compile and run the default project.

In order to get the IDE to compile and run your program, you have to do one of the following:

  • Create a new project for your program (and remember to open this project when you start the IDE).
  • Set your preference to File mode (in which case, the IDE will compile and run the active file that is open in the editor). See the Executable Preferences Page for more information.

Question. Do Irie Pascal CGI programs run on UNIX servers? I tried to run the simple hellocgi on a unix server, but it didn't seem to like it (Server error 500). However, your website seems to indicate that Irie Pascal will run on a UNIX server. Is this correct ?

Answer. Yes, programs compiled with Irie Pascal will run on UNIX webservers (the Apache webserver running on Linux, FreeBSD, Solaris/x86, or Solaris/Sparc servers).

The first thing I do when a CGI program doesn't run is to try running the program from the command-line. If the program still does not run, at least I will get an error message telling me the reason for the failure. On the other hand, if the program does run, and the output looks ok then I know it's a server configuration issue.

If you don't have access to the command-line on the server then things get a little trickier to troubleshoot. In that case try the following checklist:

  • If you are using the evaluation version of Irie Pascal, the program you are trying to run may have expired (compile and install the program just before trying to run it, just to be on the safe side).
  • Does the program you want to run have the executable permission set for "other"?
  • Is the Irie Virtual Machine (IVM) installed on the server the correct edition? (i.e. if the server is running Linux then make sure the Linux edition of the IVM is installed on the server).
  • Make sure that the program has a #! header pointing at the interpreter. See Irie Pascal CGI support for Apache (UNIX).

Question. Is Irie Pascal compatible with Turbo Pascal?

Answer. No. Although both Irie Pascal and Turbo Pascal support Standard Pascal (more or less), they also each support some extensions that the other does not. It is unlikely that you will be able to port any significant program from one to the other without making major modifications.

Question. My Pascal program does not work with Irie Pascal even though it works with another Pascal compiler. What's wrong?

Answer. There are many different dialects of the Pascal programming language, and each Pascal compiler tends to support a slightly different dialect./p>

There are two main dialects of Pascal. One main dialect is the official standard for Pascal (called Standard Pascal). Standard Pascal is defined by the International Organization for Standardization (ISO), and is known officially as ISO/IEC 7185.

Irie Pascal supports almost all of Standard Pascal with a few documented exceptions. The other main dialect is the one supported by Turbo Pascal. For many years, Turbo Pascal was the most popular Pascal compiler and so when many people think of Pascal they think of the Turbo Pascal dialect.

Almost all Pascal compilers (including Irie Pascal) support Standard Pascal, meaning they will compile programs that follow the Standard Pascal rules. However almost all Pascal compilers also support extra features that are not a part of Standard Pascal, but the problem with this is that different compilers support different extra features, and support them in different ways. So the result is that if you write your program in Standard Pascal then it will probably work with almost all Pascal compilers, but if you use extra features that are not a part of Standard Pascal then your programs become more compiler specific and will only work with some compilers. In some cases, if you use extra features that are supported by only one compiler then your programs will only work with that one compiler.

Question. Is there any way I can write a program that directs (writes) output to a printer?

Answer. Irie Pascal does not really support printing. However you can taker advantage of the support for printing, built into Windows (see below for more details). Please note however that although the technique described below seems to work it is not officially supported (in other words, use at your own risk).

Anyway, the official word on printing using Irie Pascal is below:

Irie Pascal does not directly support generating programs that can print to a printer. However in most cases, you can write programs that will print through Windows. The basic idea is to define a text file variable, and assign it a name that either refers to a printer port or the name of a printer on the network. Then you open the file variable (using rewrite) and use the file variable to send output to the printer (using write or writeln).

  • To print to a printer attached to the first printer port (i.e. parallel port) on your computer, use 'LPT1:' as the name assigned to the file variable (NOTE: The colon at the end of the name is required). If that doesn't work you might try the names 'PRN' or 'PRN1'.
  • To print to a printer over the network, you need the name of the printer on the network (it will probably look something like '\\network-path\printer'). You may need to consult your network admin (unless of course, you are the network admin).

Question. Can I write a program that uses graphics?

Answer. No, you can't use Irie Pascal to create programs that use Windows graphics, fonts, menus etc.

Question. The compiler gives me line references for errors but these line numbers do not show up in the written program. So how do I know which line is being referred to?

Answer. The compiler is just numbering your program from the first line (line number 1) to the last line, incrementing by one each time. So for example, if your program has 20 lines then each line is numbered from 1 to 20 starting with the first line. I am not sure if I answered your question, you might have been asking how do you get to the line in your program that the error messages are referring to.

  • If you are using the Windows Edition of Irie Pascal and you are using the Irie Pascal IDE (as opposed to the command-line compiler) then the easiest way to get to the line in your program referenced by an error message is to double-click on the error message and the IDE will automatically take you to the line (and column) in your program were the error was detected. You can also press Ctrl-G to go to any line in your program, the IDE will ask you to enter a line number and then it will take you to that line. NOTE: As you move around in the editor you can always tell what line you are on and your column position in that line, by looking at the two numbers seperated by a colon in the status bar at the bottom of the IDE window, the first number is the line number and the second number is the column position.
  • If you are not using the Irie Pascal IDE then the text editor you are using probably has a way to go to a particular line.

Question. What's the command for clearing the screen in Irie Pascal?

Answer. The built-in procedure clrscr can be used to clear the screen. However clrscr is only supported on the Windows Edition of Irie Pascal. Because Irie Pascal runs on so many different platforms it is difficult to take maximum advantage of each platform. So far the priority has been on developing features that can be easily ported to all supported platforms. Unfortunately I/O (advanced console, graphics, sound etc) tends to be very non-portable and has so far not been fully implemented.

Question. How do I search directories using Irie Pascal?

Answer. In Irie Pascal directories are just lists of filenames (I am using the term list in the general sense, I'm not referring to the special list type defined in the Irie Pascal programming language). Most operating systems don't allow you to manipulate directories using the file procedures, so Irie Pascal provides a separate group of procedures for manipulating directories. These procedures are opendir, readdir, rewinddir, and closedir.

The sample program "listdir.pas" is a simple program that shows how to use most of the built-in directory procedures. Take a look at "listdir.pas" (in the samples directory) and experiment with it if you like.

Question. When I compiled my program I had expected it to indent (tab) my program but it did not. How do I get it to do this?

Answer. Sorry, but Irie Pascal does not automatically indent your programs.

Prev previous page Buy
Next next page Manuals