You are not logged in.

#1 2011-10-26 11:07:41

E_user
Member
From: Prague
Registered: 2011-09-22
Posts: 22

[SOLVED] - Pascal and Geany

Hello,

I have installed pacman -S geany fpc and I have code:

begin
	writeln('hello');
end.

>>F5

./hello: line 1: begin: command not found
./hello: line 2: syntax error near unexpected token `'hello''
./hello: line 2: `	writeln('hello');'

------------------
(program exited with code: 2)
Press return to continue

Then I have this error, and I don't know where is the problem.
Please, help me. Thank you...

Last edited by E_user (2011-10-26 18:50:36)

Offline

#2 2011-10-26 11:28:09

electric_indigo
Member
Registered: 2011-05-12
Posts: 89

Re: [SOLVED] - Pascal and Geany

I haven't used Pascal for years, but I think you should put the “program” line at the beginning.

Offline

#3 2011-10-26 13:35:24

peterb
Member
Registered: 2011-10-05
Posts: 27

Re: [SOLVED] - Pascal and Geany

Use:

program Hello;
begin
  writeln ('Hello')
end.

There's also a nice IDE for FreePascal, Lazarus. Maybe you want to try it.

Offline

#4 2011-10-28 09:56:16

trontonic
Member
Registered: 2008-07-21
Posts: 80

Re: [SOLVED] - Pascal and Geany

If you select File -> New (with Template) -> program.pas in Geany, then add

writeln('hello');

after "begin", save it, press F8 to build and F5 to run, it should work. (Works here).
While Lazarus is great for creating GUI applications with FPC, Geany is a comfortable editor/environment.

Last edited by trontonic (2011-10-28 09:57:06)

Offline

Board footer

Powered by FluxBB