Re: [fpc-pascal] PASCAL programming for Novice

2007-06-09 Thread Rick Seiden

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

2007-06-09 Thread Rick Seiden
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] Linux Linking Error]

2007-06-04 Thread Rick Seiden
(I sent this earlier today, but haven't seen it on the list.  It's been 
over 5 hours, so I'm resending.  I'm sorry if you end up getting both!)


From the FPC IDE.  I have not installed Lazarus at this point.

I'm not sure how to compile from the command line.  I'm sorry, I'm a 
lame Windows person trying to make it in the Linux world, so command 
line calls aren't second nature to me.  I can't even get the mouse to 
work in the FPC IDE!


So, if you could give me the command I should use to compile, I'd be 
happy to post the full error message.


Thanks again
Rick

Michael Van Canneyt wrote:

On Sun, 3 Jun 2007, Rick Seiden wrote:

  

Using Ubuntu 6.10 under VMWare, I get an error when I try to compile any
program.  The error is not real descriptive, and isn't really helpful.  It
puts the error at the last line (end.) in the first column, and all it says is
Error while linking.  I've googled, and it doesn't look to be a 32bit v 64bit
issue.  I ran fpc -i, and the target cpu is listed as i386.

Any help would be appreciated.



I assume you are running this from some IDE ? The text mode IDE or the Lazarus 
IDE.
It would be instructive to try and compile from the command-line, this way
you'll get the complete error message.

In the case of Lazarus, start lazarus from within a console window. The
error messages of the compiler and linker will then also be displayed on
the console window.

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


--

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

[fpc-pascal] Linux Linking Error solved

2007-06-04 Thread Rick Seiden
I emailed yesterday about an error when compiling in Linux.  The error I 
received was Error while linking.


I figured out that the permissions on /usr/bin/ld is set to root, and 
I'm logged in as a different user.  When I sudo fp to start Free Pascal, 
I am able to compile without a problem.


Just wanted to share the solution. 


Rick

--

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] Linux Linking Error solved

2007-06-04 Thread Rick Seiden

-rwxr-xr-x 1 root root 444104 2006-06-08 04:09 ld

You would think that would allow me to execute it as a normal user.  The 
only thing I shouldn't be able to do as non-root, non-root-group member 
is write it, but...


I was going to copy and paste the output to prove that it didn't  do it, 
but when I tested it this time, it did work.  I swear that the error 
said it couldn't find /usr/bin/ld.  I just did ls, saw it there, with 
the root ownership, and then ran sudo fpc sockser.pas, and the error 
went away.


Micha Nelissen wrote:

Rick Seiden wrote:
  

I emailed yesterday about an error when compiling in Linux.  The error I
received was Error while linking.

I figured out that the permissions on /usr/bin/ld is set to root, and
I'm logged in as a different user.  When I sudo fp to start Free Pascal,
I am able to compile without a problem.



What are the permissions exactly ? You should be able to execute ld as
normal user at least.

Micha
___
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


[fpc-pascal] No Browser Info Available

2007-06-04 Thread Rick Seiden
I'm having problems running fp ide under Ubuntu 6.x under VMWare 
Workstation 5.5.


I go to an xterm session, and then run fp.  The first mouse click 
generates an error that is obviously from FP.  It says


No Browser info available

with an OK button.

After that the mouse won't work in the terminal window at all.  I've 
searched and can't find anything on this.  Anyone have any ideas?


Thanks in advance.

--

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


[fpc-pascal] Linux Linking Error

2007-06-03 Thread Rick Seiden
Using Ubuntu 6.10 under VMWare, I get an error when I try to compile any 
program.  The error is not real descriptive, and isn't really helpful.  
It puts the error at the last line (end.) in the first column, and all 
it says is Error while linking.  I've googled, and it doesn't look to be 
a 32bit v 64bit issue.  I ran fpc -i, and the target cpu is listed as i386.


Any help would be appreciated.
Rick

--

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] Timers in FPC

2007-06-01 Thread Rick Seiden
There's a contributed units http://www.freepascal.org/contrib/db.php3 
link on the freepascal.org home page.  Perhaps it could go there.  Right 
under it is a Contribute http://www.freepascal.org/contrib/add.php3 
link that allows you to add it to the contributed units database.


I know this isn't adding it to the base RTL stuff, but it's a start for 
now, no?


Graeme Geldenhuys wrote:

 I guess I'm a bit late in asking, seeing that I already implemented by
 own thread based timer. I works 100% for what I need. I just wondered
 if there was something like that built into FPC that I missed.  I
 would like to compare the implementations, or share mine if FPC
 doesn't have one.

You're welcome to share yours.

Michael.



Hopefully somebody could find this useful or possibly it could find
its way into FPC and be the beginnings of a basic timer in FPC.  Why
must everybody always reinvent the wheel.  :-)

See attached file: threadtimer.pas

Usage:
---

 FTimer := TFPTimer.Create(nil);
 FTimer.OnTimer  := @FTimerTimer;
 FTimer.Interval := 500;  // in milliseconds
 FTimer.Enabled  := False;

You can then call functions like:
FTimer.On;
FTimer.Off;
FTimer.Enabled := False;




___
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] Socket samples besides the bastisoft site?

2007-05-31 Thread Rick Seiden
I second that motion.  I've been trying to figure out how to use the 
example in the rtl manual to create a simple server/client connection, 
and I've been having problems.  An example outside of that would be very 
helpful.  A tutorial.  Something.


Francisco Reyes wrote:
Can't find examples for socket programming besides 
http://www.bastisoft.de/pascal/pasinet.html


Does anyone knows of any other samples/links?

___
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


[fpc-pascal] RTL Manual pages 1056-1057 code listing question

2007-05-26 Thread Rick Seiden
I copied the code for socksrv.pp on pages 1056-1057 into FPC, and got a 
compilation error.  I double checked the code, and it is the same as 
what's in the manual.


My system:
   Windows XP
   FreePascal IDE for Win32 for i386
   Target CPU: i386
   Version 1.0.8 2006/08/21
   (Compiler Version 2.0.4)
   (Debugger GDB 6.2.1)

The error I get on Run/Compile is:
   socksrv.pp(34,26) Error: Call by var parameters have to match 
exactly: Got ShortString expected TInetSockAddr


The error I get is on the following line:
   if not Accept(S,FromName,Sin,Sout) then

I looked in the manual, and it defines Accept as follows:
   function Accept(Sock: LongInt;var Addr;var Addrlen: LongInt) : LongInt
   function Accept(Sock: LongInt;var addr: TInetSockAddr;var SockIn: 
File of ;var SockOut: File of ) : Boolean
   function Accept(Sock: LongInt;var addr: TInetSockAddr;var SockIn: 
text;var SockOut: text) : Boolean
   function Accept(Sock: LongInt;var addr: String;var SockIn: text;var 
SockOut: text) : Boolean
   function Accept(Sock: LongInt;var addr: String;var SockIn: File of 
;var SockOut: File of ) : Boolean



Based on the code, it appears that the example code is trying to use 
fourth definition, but the compiler appears to be expecting the third 
definition.


I have experience with Delphi, and have used it in the past to write 
socket based code.  I just don't have experience with FPC.  Any help you 
can give as to why the code from the manual isn't working would be 
appreciated.


Thanks in advance
Rick

PS: I searched the archives before posting.  If this is a repost, please 
accept my apologies.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal