Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-05

Re: fpc-pascal Digest, Vol 71, Issue 69

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Roger Bailey

OK, I give up. How do you handle standard input and output files in FPC? When I write something like:

	nextcharacter := input^

I get "error: 1: Illegal qualifier". Does FPC not support this standard Pascal feature?

The documentation is extremely unhelpful in this area. The LRG just says "The default Input, Output and StdErr file types are defined in the system unit", and the system unit describes a record structure that doesn't seem to contain a field that might be a file buffer.

Jonas Maebe
to Roger Bailey
Roger Bailey wrote 5 lines
OK, I give up. How do you handle standard input and output files in FPC? When I write something like: nextcharacter := input^ I get "error: 1: Illegal qualifier". Does FPC not support this standard Pascal feature?

No, it does not. FPC mainly supports Borland-style Pascal dialects, and they are not ISO Standard/Extended Pascal compliant. If you want to write ISO Pascal programs, GPC (http://www.gnu-pascal.de/gpc/h-index.html) is probably better suited to your needs.

Jonas

PS: please use a descriptive mail subject in the future.

Jürgen Hestermann
to Roger Bailey: OK, I give up. How do you handle standard input and output files in FPC? When I write…
Roger Bailey schrieb: OK, I give up. How do you handle standard input and output files in FPC? When I write something like: nextcharacter := input^ I get "error: 1: Illegal qualifier". Does FPC not support this standard Pascal feature?

I have never seen such a syntax before. Shouldn't this be done via READ (and WRITE)? They apply to standard input and output when giving no file name as first parameter. So with

var c : char;
read(c);

should read the next character from standard input I think.