Help getting started with FPC

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Help getting started with FPC

Edward Kearns
I am new to FPC, and can't get started. I have used Think Pascal, and  
I seem to have quite a hurdle here. Someone else told me that I need  
to start XCode first. I did that, then I chose a  template (FPC  
Carbon Application 2.2.0). Then I didn't know how to enter code, so I  
opened start.pas, entered some code, tried to do "build and run,"  
"compile," and none of these ran my simple code. what am I missing?

Ed
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Help getting started with FPC

Chris Kirkpatrick
I suggest you look at the FPC/Lazarus Wiki
http://wiki.freepascal.org/
for ideas to get you started.

It may be easier to start programmng using either the FPC IDE which
comes with the FPC package, or the Lazarus IDE which can be used either
to produce Windowed GUI applications or simple Pascal console-mode programs.

The FPC manuals at
http://www.freepascal.org/docs.html
contain a lot of information to get you going

You will find the FreePascal/Lazarus community very supportive, eg in
this mailing list. I have very rarely seen the comment 'RTFM', though
people very often offer links to suitable places to get information.

Hope this helps
Regards - Chris


Edward Kearns wrote:

> I am new to FPC, and can't get started. I have used Think Pascal, and
> I seem to have quite a hurdle here. Someone else told me that I need
> to start XCode first. I did that, then I chose a template (FPC Carbon
> Application 2.2.0). Then I didn't know how to enter code, so I opened
> start.pas, entered some code, tried to do "build and run," "compile,"
> and none of these ran my simple code. what am I missing?
>
> Ed
> _______________________________________________
> fpc-pascal maillist - [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Help getting started with FPC

Jonas Maebe-2
In reply to this post by Edward Kearns

On 30 Nov 2007, at 19:49, Edward Kearns wrote:

> I am new to FPC, and can't get started. I have used Think Pascal,  
> and I seem to have quite a hurdle here. Someone else told me that I  
> need to start XCode first. I did that, then I chose a  template  
> (FPC Carbon Application 2.2.0). Then I didn't know how to enter  
> code, so I opened start.pas, entered some code, tried to do "build  
> and run," "compile," and none of these ran my simple code. what am  
> I missing?

Xcode /is/ a quite complex environment, and there is no quick "do  
this and you can do everything you want with Xcode" document, only  
the slower "experiment and read its documentation" way.

If you want something more akin to Think Pascal, you may want to try  
LWP, which is available here:
http://sourceforge.net/projects/lightweight-ide


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Help getting started with FPC

Edward Kearns
In reply to this post by Edward Kearns
 >> If you want something more akin to Think Pascal, you may want to  
try LWP, which is available here:
http://sourceforge.net/projects/lightweight-ide


Jonas>>

I did try LWP, and when I opened New Skel, and Compiled, and Ran, all  
I got were error message.

Where do I go to create my main file in LWP?

Ed

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Help getting started with FPC

Jonas Maebe-2

On 30 Nov 2007, at 22:46, Edward Kearns wrote:

>> If you want something more akin to Think Pascal, you may want to  
>> try LWP, which is available here:
>> http://sourceforge.net/projects/lightweight-ide
>
>
> I did try LWP, and when I opened New Skel, and Compiled, and Ran,  
> all I got were error message.

Which error message?

> Where do I go to create my main file in LWP?

Anywhere you want. Just make sure it starts with a program header  
(such as "program helloworld;").


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Help getting started with FPC

Edward Kearns
In reply to this post by Edward Kearns
 >>

> Where do I go to create my main file in LWP?
>

Anywhere you want. Just make sure it starts with a program header  
(such as "program helloworld;").


Jonas>>


Here's what I wrote:


Program HelloWorld;
begin

print "hello"

end.

and I'm told

No main program found. Can not build.

What extension do I need on it?

Ed
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Help getting started with FPC

Jonas Maebe-2

On 30 Nov 2007, at 23:20, Edward Kearns wrote:

> Program HelloWorld;
> begin
>
> print "hello"
>
> end.

Note that the above is not a valid Pascal program. This is the  
correct version:

Program HelloWorld;
begin

   writeln('hello');

end.

> and I'm told
>
> No main program found. Can not build.
>
> What extension do I need on it?

.p, .pas or .pp


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Help getting started with FPC

Edward Kearns
In reply to this post by Edward Kearns
 >>

Note that the above is not a valid Pascal program. This is the  
correct version:

Program HelloWorld;
begin

   writeln('hello');

end.>>

Thank you, thank you! I had a case of the dumbs, mixing languages. I  
was about ready to give up and redo my Think Pascal program in Basic,  
since I thought I would never be able to get started in this.

Thanks again!

Ed

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Help getting started with FPC

Edward Kearns
In reply to this post by Edward Kearns
Because of all the help I got, especially from Jonas Maebe, I  
successfully opened and ran successfully in LIghtweight IDE the  
Pascal program I had developed over several years in Think Pascal.  
NOW I can modify it, as I had desired.

Ed
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Help getting started with FPC

Ingemar Ragnemalm
In reply to this post by Edward Kearns
Jonas Maebe wrote:
> If you want something more akin to Think Pascal, you may want to try  
> LWP, which is available here:
> http://sourceforge.net/projects/lightweight-ide
>  

Thanks, Jonas! I think that is what Edward needs. BTW, the latest
version is at

http://www.ragnemalm.se/lightweight

It is much harder to upload to SourceForge, so I can't always do that.

Edward Kearns <[hidden email]> wrote:

> I did try LWP, and when I opened New Skel, and Compiled, and Ran, all  
> I got were error message.
>  

Then I must guess that you either have problems with the paths (strange
characters that mess up the command lines) or something is not installed
properly. What does the "about" box look like? It should tell what
compilers are installed.


> Here's what I wrote:
>
>
> Program HelloWorld;
> begin
>
> print "hello"
>
> end.
>
> and I'm told
>
> No main program found. Can not build.
>  

I took that code, created a new document in LWP, saved as "HW.pas",
fixed the "print" line
to WriteLn('hello');, hit cmd-R. It runs just fine.

> What extension do I need on it?
>  

.p, .pas, .P, .PAS, .dpr should all work in recent versions.

Let me ask:

- Is Free Pascal installed? For the target you use? (If you use an Intel
Mac, you need to change target to "Intel" unless the PPC compiler is
installed.)
- Is GCC installed? (Comes with Xcode, I don't know if you can download
it separately somewhere. AFAIK FPC needs GCC for linking.)

I am sure this can be solved pretty easily. In all my tests, LWP runs
nicely as long as FPC is installed. I will gladly fix any beginner traps
you find.


/Ingemar

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Help getting started with FPC

Ingemar Ragnemalm
In reply to this post by Edward Kearns

Edward Kearns wrote:
> Because of all the help I got, especially from Jonas Maebe, I  
> successfully opened and ran successfully in LIghtweight IDE the  
> Pascal program I had developed over several years in Think Pascal.  
> NOW I can modify it, as I had desired.
>  

That's great! What was the problem? File extensions? I'd like to know so
I can make the
error messages better.


/Ingemar

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Help getting started with FPC

Jonas Maebe-2
Ingemar Ragnemalm wrote on za, 01 dec 2007:

> That's great! What was the problem? File extensions? I'd like to know
> so I can make the
> error messages better.

When I tried it at first, I neglected to add a "Program HelloWorld;"  
header and also got the "No main program found. Can not build." error  
message. It took me a while to figure out how to tell the IDE what the  
"main program" is.

Maybe it would be handy to add "(does it have a program header?)" at  
the end of that error message.


Jonas

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Help getting started with FPC

Edward Kearns
In reply to this post by Edward Kearns
 >>


> I did try LWP, and when I opened New Skel, and Compiled, and Ran,  
> all  I got were error message.
>
>

Then I must guess that you either have problems with the paths  
(strange characters that mess up the command lines) or something is  
not installed properly. What does the "about" box look like? It  
should tell what compilers are installed.>>

First of all, note that LWP 0.2.9's demo is TransSkel.p, not  
NewSkel.p, as in the Lightweight Pascal IDE notes. Then when I do  
compile, and see nothing happen, the "about" box says:

Lightweight IDE: 0.2.9
FPC (Intel): Failed!
FPC (PPC): 2.2.0
GCC: powerpc-apple-Darwin8-gcc-4.0.1(GCC)
TransSkel: 4.0a1

Ed



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Help getting started with FPC

Edward Kearns
In reply to this post by Ingemar Ragnemalm
My problem was simply forgetting some of the syntax to use in a  
Pascal program! After I saw that, it was easy to run.

Ed

On Dec 1, 2007, at 5:13 AM, Ingemar Ragnemalm wrote:

>
> Edward Kearns wrote:
>> Because of all the help I got, especially from Jonas Maebe, I  
>> successfully opened and ran successfully in LIghtweight IDE the  
>> Pascal program I had developed over several years in Think  
>> Pascal.  NOW I can modify it, as I had desired.
>>
>
> That's great! What was the problem? File extensions? I'd like to  
> know so I can make the
> error messages better.
>
>
> /Ingemar
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Help getting started with FPC

Ingemar Ragnemalm
In reply to this post by Edward Kearns

> Edward Kearns wrote:
>
> First of all, note that LWP 0.2.9's demo is TransSkel.p, not  
> NewSkel.p, as in the Lightweight Pascal IDE notes.

Yes, that was my fault. I only included the newest demos, but NewSkel.p
should have been included all the same, since it is the example demo.
TransSkel is something completely different.

> Then when I do  
> compile, and see nothing happen, the "about" box says:
>
> Lightweight IDE: 0.2.9
> FPC (Intel): Failed!
> FPC (PPC): 2.2.0
> GCC: powerpc-apple-Darwin8-gcc-4.0.1(GCC)
> TransSkel: 4.0a1
>  

Looks perfect! (As long as you don't need to compile for Intel.)


/Ingemar

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal