Re: [fpc-pascal] PASCAL programming for Novice
Pete Cervasio writes: Contents of $HOME/.vim/filetype.vim: Thanks. Found that it also works with .pas Changed the programs to that since that is one of the extensiosn the compiler also checks for. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PASCAL programming for Novice
On Saturday 09 June 2007 18:46:17 Francisco Reyes wrote: > Daniël Mantione writes: > > It doesn't look for .p by default. Rename to .pas or .pp. > > Ok thanks. > Using .p because that is what vim checks for. Will figure out how to change > vim to look for .pp for the coloring. Contents of $HOME/.vim/filetype.vim: " my filetype file if exists("did_load_filetypes") finish endif augroup filetypedetect au! BufRead,BufNewFile *.pp setfiletype pascal augroup END Best regards, Pete C. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PASCAL programming for Novice
Daniël Mantione writes: It doesn't look for .p by default. Rename to .pas or .pp. Ok thanks. Using .p because that is what vim checks for. Will figure out how to change vim to look for .pp for the coloring. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PASCAL programming for Novice
En/na Rick Seiden ha escrit: It's what I like to call a pass through server. My ISP won't let me send email unless I'm on their network (at home). So, I have a server I wrote in VB that listens for a connection on a non standard port. When connected, it connects to my ISP's SMTP server. Anything it gets from the email client, it passes to the server. Anything it gets from the server it passes to the email client. Works like a charm. Only problem is that it's in Windows. I'm working towards getting rid of that windows box and replacing it with linux. So, I need to re-write this app in Linux. It's really the event part of it that I'm concerned with. You don't need to rewrite the app (unless you want to do it as a learning exercise). sshd can tunnel connections this way right out of the box, or if you want to do it the exact way you're doing now, you can, e.g. configure xinetd to forwar one port to your server to another port to another server (but that's extremely dangerous) Bye -- Luca ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PASCAL programming for Novice
It's what I like to call a pass through server. My ISP won't let me send email unless I'm on their network (at home). So, I have a server I wrote in VB that listens for a connection on a non standard port. When connected, it connects to my ISP's SMTP server. Anything it gets from the email client, it passes to the server. Anything it gets from the server it passes to the email client. Works like a charm. Only problem is that it's in Windows. I'm working towards getting rid of that windows box and replacing it with linux. So, I need to re-write this app in Linux. It's really the event part of it that I'm concerned with. Leonardo M. Ramé wrote: Are you trying to create a Peer-To-Peer architecture?, something like Windows Messenger?. I don't know how to implement that type of architecture, you can do a simple google search to find examples, but since it uses socket communications you can implement it using lNet or Synapse libraries with FreePascal. Leonardo M. Ramé http://leonardorame.blogspot.com --- Rick Seiden <[EMAIL PROTECTED]> wrote: Any tutorials out there on using Event Driven programming with Free Pascal? I'm hoping to create a server/client combo that will need to respond to both input from the client part, and input from the server part my server/client combo app +--+ User ---> | server part-->client part| --> another server +--+ So, when my user talks to my server, I need to be able to respond, and when the other server talks to my client, I need to be able to respond. Anyway, just a simple event driven programming tutorial using some version of Pascal will probably help. Thanks Looking for earth-friendly autos? Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center. http://autos.yahoo.com/green_center/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal -- If you never have the courage to lose sight of the shore, You'll never know the utter terror of being forever lost at sea ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] installing latest stable
On Friday 08 June 2007 18:46, Daniël Mantione wrote: > Op Fri, 8 Jun 2007, schreef pineal: > > I have downloaded a tar archive, > > > > fpc-2.1.4.i386-linux.tar > > > > there are no install instructions that I can find. Can anyone give me > > some guidance or perhaps a link. > > Please a look at the earlier e-mail today about the rebuild of this > release. > > The instructions are right next to the download link on the website: > "After untarring the archive into a temporary location, you can run the > install script by issuing the command "sh install.sh". > > So: > * Open a terinal. > * Untar the file, i.e. type "tar xvzf fpc-2.1.4.i386-linux.tar". > * Type "sh install.sh". > > Daniël Hi Daniel, I have spent the whole afternoon trying to install fpc. :( First I downloaded the .rpm files. The compiler and docs install fine but the source doesn't install anything and there is no error or warning. So I tried the same source rpm from a different mirror with the same result. So I removed those, downloaded the new 2.1.4a archive, unpacked it and ran the install script (which I had to interrupt and run a second time as root) which ran without showing an error and yet I still have no source installed. any ideas please? neal. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PASCAL programming for Novice
Op Sat, 9 Jun 2007, schreef Francisco Reyes: > FreePascal doesn't look in the current directory by default? > I had to use > uses > HelloWorld in 'HelloWorld.p'; ___ It doesn't look for .p by default. Rename to .pas or .pp. Daniël___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PASCAL programming for Novice
Leonardo M. Ramé writes: With Object Pascal (and Pascal), you can divide your program in units, then use those units in a program. Thanks for the example! uses HelloWorld; // this includes HelloWorld into your program FreePascal doesn't look in the current directory by default? I had to use uses HelloWorld in 'HelloWorld.p'; ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PASCAL programming for Novice
Francisco Reyes wrote: Michael Van Canneyt writes: Both Turbo Pascal's Object Pascal and Delphi's object pascal are supported, depending on which mode you compile in. If I have a class like: program myclass; type THelloWorld = class procedure Put; end; var HelloWorld: THelloWorld; procedure THelloWorld.Put; begin WriteLn('Hello, World!'); end; begin HelloWorld := THelloWorld.Create; HelloWorld.Put; HelloWorld.Free; end. How do I use that class in another program? You can: uses UnitWithHello; ... var VHello: THelloWorld; begin VHello := THelloWorld.Create; try VHello.Put; finally VHello.Free; end; or you can: unit UnitWithHello; type THelloWorldClass = class of HelloWorld; THelloWorld = class procedure Put; virtual; abstract; end; ... unit AnotherUnit; uses UnitWithHello; ... procedure DoHello(AHelloClass: THelloWorldClass); var VHello: THelloWorld; begin VHello := AHelloClass.Create; try VHello.Put; finally VHello.Free; end; or you can: uses UnitWithHello; type THelloWrapper = class private FHello: THelloWorld; function GetHello: THelloWorld; protected function InternalHelloClass: THelloWorldClass; virtual; abstract; property Hello: THelloWorld read GetHello; public destructor Destroy; override; end; ... destructor THelloWrapper.Destroy; begin FHello.Free; inherited; end; function THelloWrapper.GetHello: THelloWorld; begin if not Assigned(FHello) then FHello := InternalHelloClass.Create; Result := FHello; end; or you can: uses UnitWithHello; type THelloWrapper = class private FHello: THelloWorld; FHelloClass: THelloWorldClass; function GetHello: THelloWorld; protected property Hello: THelloWorld read GetHello; public constructor Create(AHelloClass: THelloWorldClass); destructor Destroy; override; end; ... constructor THelloWrapper.Create(AHelloClass; THelloWorldClass); begin Assert(Assigned(AHelloClass), 'error'); inherited Create; FHelloClass := AHelloClass; end; destructor THelloWrapper.Destroy; begin FHello.Free; inherited; end; function THelloWrapper.GetHello: THelloWorld; begin if not Assigned(FHello) then FHello := FHelloClass.Create; Result := FHello; end; And so on. -- Joao Morais ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PASCAL programming for Novice
Francisco, that's not only a class, it's a Program containing the THelloWorld class. With Object Pascal (and Pascal), you can divide your program in units, then use those units in a program. Example: Unit HelloWorld; interface type THelloWorld = class procedure Put; end; implementation procedure THelloWorld.Put; begin WriteLn('Hello, World!'); end; end. program MyProgram uses HelloWorld; // this includes HelloWorld into your program var myHelloWorl: THelloWorld; // to declare a variable of type THelloWorld begin myHelloWorld := THelloWorld.Create; // to create an instance of THelloWorld. myHelloWorld.Put;// to execute Put method. myHelloWorld.Free; // to destroy the instance. end. --- Leonardo M. Ramé http://leonardorame.blogspot.com --- Francisco Reyes <[EMAIL PROTECTED]> wrote: > Michael Van Canneyt writes: > > > Both Turbo Pascal's Object Pascal and Delphi's object pascal are > > supported, depending on which mode you compile in. > > If I have a class like: > program myclass; > type >THelloWorld = class > procedure Put; >end; > var >HelloWorld: THelloWorld; > procedure THelloWorld.Put; > begin >WriteLn('Hello, World!'); > end; > begin >HelloWorld := THelloWorld.Create; >HelloWorld.Put; >HelloWorld.Free; > end. > > > How do I use that class in another program? > > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > Need a vacation? Get great deals to amazing places on Yahoo! Travel. http://travel.yahoo.com/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PASCAL programming for Novice
Are you trying to create a Peer-To-Peer architecture?, something like Windows Messenger?. I don't know how to implement that type of architecture, you can do a simple google search to find examples, but since it uses socket communications you can implement it using lNet or Synapse libraries with FreePascal. Leonardo M. Ramé http://leonardorame.blogspot.com --- Rick Seiden <[EMAIL PROTECTED]> wrote: > Any tutorials out there on using Event Driven programming with Free Pascal? > > I'm hoping to create a server/client combo that will need to respond to > both input from the client part, and input from the server part > >my server/client combo app > +--+ > User ---> | server part-->client part| --> another server > +--+ > > So, when my user talks to my server, I need to be able to respond, and > when the other server talks to my client, I need to be able to respond. > > Anyway, just a simple event driven programming tutorial using some > version of Pascal will probably help. > > Thanks > Looking for earth-friendly autos? Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center. http://autos.yahoo.com/green_center/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PASCAL programming for Novice
Michael Van Canneyt writes: Both Turbo Pascal's Object Pascal and Delphi's object pascal are supported, depending on which mode you compile in. If I have a class like: program myclass; type THelloWorld = class procedure Put; end; var HelloWorld: THelloWorld; procedure THelloWorld.Put; begin WriteLn('Hello, World!'); end; begin HelloWorld := THelloWorld.Create; HelloWorld.Put; HelloWorld.Free; end. How do I use that class in another program? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PASCAL programming for Novice
Any tutorials out there on using Event Driven programming with Free Pascal? I'm hoping to create a server/client combo that will need to respond to both input from the client part, and input from the server part my server/client combo app +--+ User ---> | server part-->client part| --> another server +--+ So, when my user talks to my server, I need to be able to respond, and when the other server talks to my client, I need to be able to respond. Anyway, just a simple event driven programming tutorial using some version of Pascal will probably help. Thanks Michael Van Canneyt wrote: On Sat, 9 Jun 2007, Francisco Reyes wrote: Leonardo M. Ramé writes: After reading the tutorial suggested by Daniel, you sould go to http://en.wikipedia.org/wiki/Delphi_(programming_language) and follow a link to "object pascal language guide" to learn Object Pascal. Looking at http://en.wikipedia.org/wiki/Object_Pascal I see there are different syntax for objects. Which one does FreePascal uses? They list: Apple's Object Pascal Turbo Pascal's Object Pascal Delphi's Object Pascal Both Turbo Pascal's Object Pascal and Delphi's object pascal are supported, depending on which mode you compile in. Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal -- If you never have the courage to lose sight of the shore, You'll never know the utter terror of being forever lost at sea ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PASCAL programming for Novice
On Sat, 9 Jun 2007, Francisco Reyes wrote: > Leonardo M. Ramé writes: > > > After reading the tutorial suggested by Daniel, you sould go to > > http://en.wikipedia.org/wiki/Delphi_(programming_language) and follow a link > > to "object pascal > > language guide" to learn Object Pascal. > > Looking at http://en.wikipedia.org/wiki/Object_Pascal I see there are > different syntax for objects. > > Which one does FreePascal uses? > > They list: > Apple's Object Pascal > Turbo Pascal's Object Pascal > Delphi's Object Pascal Both Turbo Pascal's Object Pascal and Delphi's object pascal are supported, depending on which mode you compile in. Michael.___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PASCAL programming for Novice
Leonardo M. Ramé writes: After reading the tutorial suggested by Daniel, you sould go to http://en.wikipedia.org/wiki/Delphi_(programming_language) and follow a link to "object pascal language guide" to learn Object Pascal. Looking at http://en.wikipedia.org/wiki/Object_Pascal I see there are different syntax for objects. Which one does FreePascal uses? They list: Apple's Object Pascal Turbo Pascal's Object Pascal Delphi's Object Pascal Chrome's Object Pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PASCAL programming for Novice
After reading the tutorial suggested by Daniel, you sould go to http://en.wikipedia.org/wiki/Delphi_(programming_language) and follow a link to "object pascal language guide" to learn Object Pascal. --- Daniël Mantione <[EMAIL PROTECTED]> wrote: > > > Op Sat, 9 Jun 2007, schreef Aruna Goke: > > > I am completely new to programming and I have been watching this list over > > some few months. > > > > I would be glad, if i can get a link to where I can get a book to download > > in > > order to learn pascal. > > Here is an on-line tutorial: http://www.taoyue.com/tutorials/pascal > Pinpoint customers who are looking for what you sell. http://searchmarketing.yahoo.com/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PASCAL programming for Novice
Op Sat, 9 Jun 2007, schreef Aruna Goke: > I am completely new to programming and I have been watching this list over > some few months. > > I would be glad, if i can get a link to where I can get a book to download in > order to learn pascal. Here is an on-line tutorial: http://www.taoyue.com/tutorials/pascal > Can someone tell me where i can get free pascal compiler for ms-windows ?? Here: http://www.freepascal.org/download.var Daniël___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] PASCAL programming for Novice
I am completely new to programming and I have been watching this list over some few months. I would be glad, if i can get a link to where I can get a book to download in order to learn pascal. Can someone tell me where i can get free pascal compiler for ms-windows goksie ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC only 32 bits?
> Marco van de Voort writes: > > > It is possible to create a binary for amd64, but that binary doesn't work, > > and I don't know why. FreeBSD keeps complaining it can't execute it. > > > Marco, since you were able to do this cross compile once, doesn't that mean > you have the cross-binutils for 6.2? Any chance you could put them somewhere > for me? > > Where did you get them or how did you compile them? Compiled them from Gnu.org sources ? Only trick is to add --disable-nls and set the target to configure. IIRC there is a script to mass-build crossbinutils on *nix in the fpcbuild repository. (install/scripts or so) ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal