[fpc-pascal] national support

2006-07-26 Thread Friš Martin Mgr








I give additional details. I write
programs for mathematical linguistics. Especially program for frequency
dictionary of chosen text. I write text to the editor. The text is in Czech. It
displays correctly in editor window , i.e. with diacritics. Then follows
transformation into words. In program for frequency diactionary, which contains
binary search I have usual read and write statements. When I send the result to
the printer with write it is displayed incorrectly on the print output –
the diacritics. I am working under Windows |X|P.

    What other details
should I give for somebody to give me advice.

   Martin Fris

 

-Original Message-
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Friš Martin Mgr
Sent: Monday, July 10, 2006 2:21
PM
To:
fpc-pascal@lists.freepascal.org
Subject: [fpc-pascal] national
support

 

I am enthusiastic user of Free
Pascal. I want ask a question, if there in Free Pascal exist the support for national
environment. In czech there are letters with diacritics. They are not displayed
correctly on the screen and on the printer. In Windows there is code page 1250
for these signs. Is there something in Free pascal?

Martin Fris

 

 






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

Re: [fpc-pascal] Compiling the compiler

2006-07-26 Thread Florian Klaempfl
Andreas Berger wrote:
> I am using the v20 base compiler 

The only supported bootstrapping compiler is the last release compiler, i.e. 
2.0.2.

> with the v21 source. It should create a
> v21 compiler.
> 
> I get the same error compiling under DOS, Win98 and Win2K
> 
> Regards, Andreas
> 
> Lee, John wrote:
>> This is a known error - I get it too - but I only get when using the
>> v2.1.1 compiler to start make. Do you get it when starting with the
>> v2.0.2 release compiler released too? What about trying a snapshot of
>> v20 compiler eg base_go32_v20.zip or similar.
>>
>> You can get more info with "opt=-va" on CL - If there is any more
>> useful info in that send the lines to us. 
>> What system are you using for these makes? Dos? Win9x?
>>  
>>> I have a problem compiling the compiler. After a lot of compilation
>>> it attempts to compile pp.pas and I get the following error:
>>> pp.pas(213,1) Error: Entrypoint start not defined.
>>>
>>> Regards,
>>> Andreas
>>>
>>> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal

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


Re: [fpc-pascal] national support

2006-07-26 Thread Michael Van Canneyt


On Wed, 26 Jul 2006, Friš Martin Mgr wrote:

> I give additional details. I write programs for mathematical linguistics. 
> Especially program for frequency dictionary of chosen text. 
> I write text to the editor. The text is in Czech. It displays correctly in 
> editor window , 
> i.e. with diacritics. Then follows transformation into words. In program for 
> frequency 
> diactionary, which contains binary search I have usual read and write 
> statements. 
> When I send the result to the printer with write it is displayed incorrectly 
> on the 
> print output - the diacritics. I am working under Windows |X|P.

You cannot do that; The screen is in codepage 1250 (or 1251), but the codepage 
of the
printer is most likely 850 or so (whatever plain ascii is). What you can try to 
do is 
to use the windows  AnsiToOEMChar routine to convert the windows codepage to 
something 
that the printer understands.

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

Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Vinzent Hoefler
On Monday 17 July 2006 19:12, Florian Klaempfl wrote:

> I started also a wiki page about it
> http://www.freepascal.org/wiki/index.php/OpenMP_support where ideas
> can be written down and shared.

Well, I just added some stuff there, yesterday. It's far from being 
complete yet (it just covers a basic "parallel" construct), nor is it 
really thought through yet, but well, it might be a start; something to 
begin with.

Any suggestions are welcome, of course.

Due to the fact, that the OpenMP specification is neither the easiest 
one to read or understand, and it's not particularly tiny, neither, I 
don't want to put hours and hours of then wasted effort into this, if 
everyone here thinks that this idea is total crap.

And yes, I admit, I like code being a little bit more verbose. :)


Vinzent.

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


[fpc-pascal] Apache processing cgi requests

2006-07-26 Thread Graeme Geldenhuys

For all those Apache and CGI gurus...

[This might be off-topic]

I have written a CGI app for my client that decrypts a Macromedia
Flash files (*.swf) to a set path and name ("/flash/movie.swf"), I
then generate a html file to view that file, and the client (web
browser) gets served.  The average *.swf file size is around 100Kb.

This CGI app might serve around 30-40 people simultaneously at peak
times.  In our testing, I would have thought that even though all
30-40 people are viewing different *.swf files, some might get served
the wrong file (due to the decrypted file always having a constant
name).  Our testing proved otherwise, we always received the correct
swf movie?

This brings me to my question.  How does Apache handle CGI requests?
Does it queue them and serve them  (including all resources: images,
swf files, etc) one at a time or process them all at the same time?

Note: For the release version, I changed the decrypted file to use a
GUID Session ID in the output name - just to be sure there is no
potential problems!

I am using Apache 2 with the MPM worker on a Linux box. The worker MPM
provides a threaded implementation for Apache2.

Regards,
 Graeme.


--
There's no place like 127.0.0.1
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Apache processing cgi requests

2006-07-26 Thread Michael Van Canneyt


On Wed, 26 Jul 2006, Graeme Geldenhuys wrote:

> For all those Apache and CGI gurus...
> 
> [This might be off-topic]
> 
> I have written a CGI app for my client that decrypts a Macromedia
> Flash files (*.swf) to a set path and name ("/flash/movie.swf"), I
> then generate a html file to view that file, and the client (web
> browser) gets served.  The average *.swf file size is around 100Kb.
> 
> This CGI app might serve around 30-40 people simultaneously at peak
> times.  In our testing, I would have thought that even though all
> 30-40 people are viewing different *.swf files, some might get served
> the wrong file (due to the decrypted file always having a constant
> name).  Our testing proved otherwise, we always received the correct
> swf movie?
> 
> This brings me to my question.  How does Apache handle CGI requests?
> Does it queue them and serve them  (including all resources: images,
> swf files, etc) one at a time or process them all at the same time?

They are processed at the same time. Apache works threaded, so multiple 
versions of your CGI script could be running at the same time. You could 
simply have used the GetTempFileName function from SysUtils to avoid 
concurrency problems. Although using a GUID as a filename is just as good.

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


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Micha Nelissen
Vinzent Hoefler wrote:
> Well, I just added some stuff there, yesterday. It's far from being 
> complete yet (it just covers a basic "parallel" construct), nor is it 
> really thought through yet, but well, it might be a start; something to 
> begin with.
> 
> Any suggestions are welcome, of course.

Does parallel mean all the statements in the block can be executed in
parallel, or that multiple copies of the block of statements can be
started in parallel ?

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


Re: [fpc-pascal] Apache processing cgi requests

2006-07-26 Thread Graeme Geldenhuys

On 7/26/06, Michael Van Canneyt <[EMAIL PROTECTED]> wrote:

They are processed at the same time. Apache works threaded, so multiple
versions of your CGI script could be running at the same time. You could
simply have used the GetTempFileName function from SysUtils to avoid
concurrency problems. Although using a GUID as a filename is just as good.

Michael.


So I guess it was pure luck that we didn't pickup any issues.  Thanks
for your quick response!

Regards,
 Graeme.


--
There's no place like 127.0.0.1
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Vinzent Hoefler
On Wednesday 26 July 2006 08:17, Micha Nelissen wrote:
> Vinzent Hoefler wrote:
> > Well, I just added some stuff there, yesterday. It's far from being
> > complete yet (it just covers a basic "parallel" construct), nor is
> > it really thought through yet, but well, it might be a start;
> > something to begin with.
> >
> > Any suggestions are welcome, of course.
>
> Does parallel mean all the statements in the block can be executed in
> parallel, or that multiple copies of the block of statements can be
> started in parallel ?

The latter.


Vinzent.

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


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Michael Van Canneyt


On Wed, 26 Jul 2006, Vinzent Hoefler wrote:

> On Wednesday 26 July 2006 08:17, Micha Nelissen wrote:
> > Vinzent Hoefler wrote:
> > > Well, I just added some stuff there, yesterday. It's far from being
> > > complete yet (it just covers a basic "parallel" construct), nor is
> > > it really thought through yet, but well, it might be a start;
> > > something to begin with.
> > >
> > > Any suggestions are welcome, of course.
> >
> > Does parallel mean all the statements in the block can be executed in
> > parallel, or that multiple copies of the block of statements can be
> > started in parallel ?
> 
> The latter.

Which is why I think that it's better to have them as local functions,
instead of having to introduce a lot of new functions.

Local functions are very pascal-ish. C doesn't have it, which is why they can't 
use it.
Let's use the language features to their full extent.

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


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Micha Nelissen
Vinzent Hoefler wrote:
> On Wednesday 26 July 2006 08:17, Micha Nelissen wrote:
>> Does parallel mean all the statements in the block can be executed in
>> parallel, or that multiple copies of the block of statements can be
>> started in parallel ?
> 
> The latter.

Strange. How many copies ?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Vinzent Hoefler
On Wednesday 26 July 2006 09:07, Micha Nelissen wrote:
> Vinzent Hoefler wrote:
> > On Wednesday 26 July 2006 08:17, Micha Nelissen wrote:
> >> Does parallel mean all the statements in the block can be executed
> >> in parallel, or that multiple copies of the block of statements
> >> can be started in parallel ?
> >
> > The latter.
>
> Strange.

That somehow applies to the whole original specification. :)

> How many copies ?

Omp.Get_Num_Threads(), AFAICS.


Vinzent.

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


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Vincent Snijders

Micha Nelissen schreef:

Vinzent Hoefler wrote:

On Wednesday 26 July 2006 08:17, Micha Nelissen wrote:

Does parallel mean all the statements in the block can be executed in
parallel, or that multiple copies of the block of statements can be
started in parallel ?

The latter.


Strange. How many copies ?


Looking at the example, I would say as many copies as there are threads:
OMP.Get_Thread_Num

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


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Micha Nelissen
Vinzent Hoefler wrote:
> On Wednesday 26 July 2006 09:07, Micha Nelissen wrote:
>> How many copies ?
> 
> Omp.Get_Num_Threads(), AFAICS.

Ah the number of threads is determined by the RTL, and any parallel
block must be written flexible, so that it can work for any given number
of threads ?

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


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Vinzent Hoefler
On Wednesday 26 July 2006 09:00, Michael Van Canneyt wrote:
> On Wed, 26 Jul 2006, Vinzent Hoefler wrote:
> > On Wednesday 26 July 2006 08:17, Micha Nelissen wrote:
> > > Vinzent Hoefler wrote:
> > > > Well, I just added some stuff there, yesterday. It's far from
> > > > being complete yet (it just covers a basic "parallel"
> > > > construct), nor is it really thought through yet, but well, it
> > > > might be a start; something to begin with.
> > > >
> > > > Any suggestions are welcome, of course.
> > >
> > > Does parallel mean all the statements in the block can be
> > > executed in parallel, or that multiple copies of the block of
> > > statements can be started in parallel ?
> >
> > The latter.
>
> Which is why I think that it's better to have them as local
> functions, instead of having to introduce a lot of new functions.

Hey, it's only *one* new keyword yet. :)

Admitted, local blocks are more Adaish, but with this approach, I was 
trying to avoid introducing a lot more keywords. There still probably 
will be some, because there are more constructs like "barrier", 
"workshare" (which I didn't fully understand yet) and "section".

And well, such blocks are already known in Object Pascal. Just look at 
them as in object declarations the public/protected/private modifiers.

> Local functions are very pascal-ish. C doesn't have it, which is why
> they can't use it. Let's use the language features to their full
> extent.

Yes. I agree with that. The problem is that there are more "variable" 
types than just shared and private (like "firstprivate"), so it might 
prove to be quite difficult to do that if you only have local 
functions. I just didn't come to that part yet.

I'll probably update the WiKi this evening/night (can't do that from 
work, where freepascal.org still times out).


Vinzent.

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


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Steve Williams

Michael Van Canneyt wrote:

Which is why I think that it's better to have them as local functions,
instead of having to introduce a lot of new functions.

Local functions are very pascal-ish. C doesn't have it, which is why they can't 
use it.
Let's use the language features to their full extent.
  


 *procedure* SubDomain (*var* x   : *array of* Float;
  istart  : Integer;
  ipoints : Integer)
 *var*
i : Integer;
 *begin*
*for* i := 0 *to* ipoints - 1 *do*
   x[istart + i] := 123.456;
 *end* /{SubDomain}/;
 
 *procedure* Sub (*var* x : *array of* Float);

 /// Variables declared here should have /|*shared*|/ context./
 /// This would include the function's parameters then.../

   *procedure* SubTask(*var* x : *array of* Float);
   *var*
 /// Variables declared here have /|*private*|/ context./
 iam : Integer;
 nt  : Integer;
 ipoints : Integer;
   *parallel*
 iam := OMP.Get_Thread_Num;  /// OMP library calls./
 nt  := OMP.Get_Num_Threads;
   
 ipoints := Length (x) *div* nt; /// size of partition/

 istart  := iam * ipoints; /// starting array index/
   
 *if* iam = Pred (nt) *then*

   ipoints := Length (x) - istart; /// last thread may do more/
   
 SubDomain (x, istart, ipoints);

   *end*;

 *begin*
   SubTask(x);
 *end* /{Sub}/;
 
 *var*

arr = *array*[0 .. ] *of* Float;
 *begin* / // Main program/
Sub (arr);
 *end*.



--
Sly



This message and its attachments may contain legally privileged or confidential 
information. This message is intended for the use of the individual or entity 
to which it is addressed. If you are not the addressee indicated in this 
message, or the employee or agent responsible for delivering the message to the 
intended recipient, you may not copy or deliver this message or its attachments 
to anyone. Rather, you should permanently delete this message and its 
attachments and kindly notify the sender by reply e-mail. Any content of this 
message and its attachments, which does not relate to the official business of 
the sending company must be taken not to have been sent or endorsed by the 
sending company or any of its related entities. No warranty is made that the 
e-mail or attachment(s) are free from computer virus or other defect.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Steve Williams

Steve Williams wrote:

  *begin*
SubTask(x);
  *end* /{Sub}/;
  
  *var*

 arr = *array*[0 .. ] *of* Float;
  *begin* / // Main program/
 Sub (arr);
  *end*.
  


Damn Thunderbird.

--
Sly



This message and its attachments may contain legally privileged or confidential 
information. This message is intended for the use of the individual or entity 
to which it is addressed. If you are not the addressee indicated in this 
message, or the employee or agent responsible for delivering the message to the 
intended recipient, you may not copy or deliver this message or its attachments 
to anyone. Rather, you should permanently delete this message and its 
attachments and kindly notify the sender by reply e-mail. Any content of this 
message and its attachments, which does not relate to the official business of 
the sending company must be taken not to have been sent or endorsed by the 
sending company or any of its related entities. No warranty is made that the 
e-mail or attachment(s) are free from computer virus or other defect.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Vinzent Hoefler
On Wednesday 26 July 2006 09:25, Micha Nelissen wrote:
> Vinzent Hoefler wrote:
> > On Wednesday 26 July 2006 09:07, Micha Nelissen wrote:
> >> How many copies ?
> >
> > Omp.Get_Num_Threads(), AFAICS.
>
> Ah the number of threads is determined by the RTL, and any parallel
> block must be written flexible, so that it can work for any given
> number of threads ?

Yes and no. I think, there are constructs to set a specific number of 
threads. And as I tried to say, the specification is quite large. If 
not to say even convoluted. I've seen easier to read stuff recently.


Vinzent.

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


Re: [fpc-pascal] Compiling the compiler

2006-07-26 Thread Andreas Berger

Florian Klaempfl wrote:

Andreas Berger wrote:
  
I am using the v20 base compiler 



The only supported bootstrapping compiler is the last release compiler, i.e. 
2.0.2.
  

That is what I am using.

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


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Vincent Snijders

Michael Van Canneyt schreef:


On Wed, 26 Jul 2006, Vinzent Hoefler wrote:


On Wednesday 26 July 2006 08:17, Micha Nelissen wrote:

Vinzent Hoefler wrote:

Well, I just added some stuff there, yesterday. It's far from being
complete yet (it just covers a basic "parallel" construct), nor is
it really thought through yet, but well, it might be a start;
something to begin with.

Any suggestions are welcome, of course.

Does parallel mean all the statements in the block can be executed in
parallel, or that multiple copies of the block of statements can be
started in parallel ?

The latter.


Which is why I think that it's better to have them as local functions,
instead of having to introduce a lot of new functions.

Local functions are very pascal-ish. C doesn't have it, which is why they can't 
use it.
Let's use the language features to their full extent.




I added an example with nested procedures.

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


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Micha Nelissen
Michael Van Canneyt wrote:
>> The latter.
> 
> Which is why I think that it's better to have them as local functions,
> instead of having to introduce a lot of new functions.

There is no real reason to restrict 'parallel' to local functions, is
there ?

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


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Vinzent Hoefler
On Wednesday 26 July 2006 09:28, Steve Williams wrote:
> Steve Williams wrote:
> >   *begin*
> > SubTask(x);
> >   *end* /{Sub}/;
> >
> >   *var*
> >  arr = *array*[0 .. ] *of* Float;
> >   *begin* / // Main program/
> >  Sub (arr);
> >   *end*.
>
> Damn Thunderbird.

Well, it tried to mimic my syntax highlighting. :) Apart from that, your 
change is quite nice, yes. That's what Michael meant, I guess.


Vinzent.

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


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Michael Van Canneyt


On Wed, 26 Jul 2006, Micha Nelissen wrote:

> Michael Van Canneyt wrote:
> >> The latter.
> > 
> > Which is why I think that it's better to have them as local functions,
> > instead of having to introduce a lot of new functions.
> 
> There is no real reason to restrict 'parallel' to local functions, is
> there ?

No, but I used that because in the example you make use of variables
defined in the local function, but also in the parent function.

It seems obvious to me that a global function can be called in parallel
at any time.  The compiler can perfectly detect whether a global
function writes to variables outside it's own scope, in which case 
it's probably a no-no to paralellize the function. The programmer
could help there by adding the parallel keyword indicating that 
the programmer knows it is safe to parallelize it.

For local functions it is less obvious, there the compiler could use 
some help in most cases...

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


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Vinzent Hoefler
On Wednesday 26 July 2006 09:46, Michael Van Canneyt wrote:

> It seems obvious to me that a global function can be called in
> parallel at any time.  The compiler can perfectly detect whether a
> global function writes to variables outside it's own scope, in which
> case it's probably a no-no to paralellize the function.

Hey, you're trying to put more burden on the compiler here as the spec 
even allows, I'd say.

Don't go on or you'll end up with the requirement for compile time 
dead-lock detection. :)


Vinzent.

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


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Michael Van Canneyt


On Wed, 26 Jul 2006, Vinzent Hoefler wrote:

> On Wednesday 26 July 2006 09:46, Michael Van Canneyt wrote:
> 
> > It seems obvious to me that a global function can be called in
> > parallel at any time.  The compiler can perfectly detect whether a
> > global function writes to variables outside it's own scope, in which
> > case it's probably a no-no to paralellize the function.
> 
> Hey, you're trying to put more burden on the compiler here as the spec 
> even allows, I'd say.
> 
> Don't go on or you'll end up with the requirement for compile time 
> dead-lock detection. :)

Well, my statement is moderate in the sense that the compiler does this
anyway already (see the hints/warnings about unused params/vars); 
let's use this information as much as we can. To avoid more difficult
detections such as possible dead-locks, I would let the programmer 
add some keywords... 

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


Re: [fpc-pascal] Compiling the compiler

2006-07-26 Thread Tomas Hajny
Andreas Berger wrote:
> Vincent Snijders wrote:
>> Andreas Berger schreef:
>>> Andreas Berger wrote:
 I have a problem compiling the compiler. After a lot of compilation
 it attempts to compile pp.pas and I get the following error:
pp.pas(213,1) Error: Entrypoint start not defined.
>>> I downloaded todays snapshot and had the same problem. Then I
>>> compiled using "make all" + "make install" instead of "make cycle"
>>> and it worked. Is this correct? What does "make cycle" do exactly?
>>
>> There is at least one difference.
>> If you do make cycle in the compiler directory, the fpc.cfg file is
>> used.
>> If you do make all or make compiler_cycle in the fpc source directory
>> (that contains a compiler subdirectory), then no fpc.cfg file is used.
>>
>> So maybe you should try make cycle OPT="-n"
>>
> Sorry, it gave the same error.

I assume you're compiling from trunk sources, right? Then we probably have
some bug in trunk compiler (binary writer/internal linker?). There's a
parameter for forcing external linker (in trunk compiler, not 2.0.2), you
can try that.

I can have a look at it later, but probably not before 2.0.4 is out.

Tomas

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


Re: [fpc-pascal] national support

2006-07-26 Thread Tomas Hajny
Fria Martin Mgr wrote:
> I give additional details. I write programs for mathematical linguistics.
> Especially program for frequency dictionary of chosen text. I write text
> to the editor. The text is in Czech. It displays correctly in editor
> window , i.e. with diacritics. Then follows transformation into words. In
> program for frequency diactionary, which contains binary search I have
> usual read and write statements. When I send the result to the printer
> with write it is displayed incorrectly on the print output - the
> diacritics. I am working under Windows |X|P.
>
> What other details should I give for somebody to give me advice.

I guess this might be enough for somebody to try - I personally have
absolutely no idea what kind of charset is used/expected when printing via
Write(Ln) to Lst under Windows, but this shouldn't be difficult to check?
Do I understand it correctly that the screen output is OK now (as opposed
to your original post)?

Tomas


> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Fria Martin
> Mgr
> Sent: Monday, July 10, 2006 2:21 PM
> To: fpc-pascal@lists.freepascal.org
> Subject: [fpc-pascal] national support
>
>
>
> I am enthusiastic user of Free Pascal. I want ask a question, if there in
> Free Pascal exist the support for national environment. In czech there are
> letters with diacritics. They are not displayed correctly on the screen
> and on the printer. In Windows there is code page 1250 for these signs. Is
> there something in Free pascal?
>
> Martin Fris

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


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Vinzent Hoefler
On Wednesday 26 July 2006 10:00, Michael Van Canneyt wrote:
> On Wed, 26 Jul 2006, Vinzent Hoefler wrote:
> > On Wednesday 26 July 2006 09:46, Michael Van Canneyt wrote:
> > > It seems obvious to me that a global function can be called in
> > > parallel at any time.  The compiler can perfectly detect whether
> > > a global function writes to variables outside it's own scope, in
> > > which case it's probably a no-no to paralellize the function.
> >
> > Hey, you're trying to put more burden on the compiler here as the
> > spec even allows, I'd say.
> >
> > Don't go on or you'll end up with the requirement for compile time
> > dead-lock detection. :)
>
> Well, my statement is moderate in the sense that the compiler does
> this anyway already (see the hints/warnings about unused
> params/vars); let's use this information as much as we can.

True. Using information that's already there, can't be wrong. I second 
that.

We're not C, where everything is standardized to be the programmer's 
problem. So yes, if concurrency will ever be implemented in the 
language, no matter how, some decent warnings/hints/notes about several 
questionable constructs would be nice.


Vinzent.

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


Re[2]: [fpc-pascal] national support

2006-07-26 Thread Пётр Косаревский
> > What other details should I give for somebody to give me advice.
> 
> I guess this might be enough for somebody to try - I personally have
> absolutely no idea what kind of charset is used/expected when printing via
> Write(Ln) to Lst under Windows, but this shouldn't be difficult to check?
> Do I understand it correctly that the screen output is OK now (as opposed
> to your original post)?
> Tomas

Some of these matters were discussed before in maillist related to "crt garbles 
writeln output" 
(http://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg05224.html is 
one of the messages).

There was a patch for that (not this) problem from Maxim Ganetsky, which can 
help to understand things.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Compiler Warning and Notices like unused variables etc.

2006-07-26 Thread Jason P Sage
I just wanted to say I LOVE the fact that the compiler warns you of these
mundane details. 

Personally, I don't consider my application at a good stopping point unless
I can make all the warnings go away. Sometimes I even will put in (hopefully
a low overhead thing when I do it)  a meaningless command to remove
"variable not initialized" warnings... when I KNOW I'm doing something to
init the variable that the compiler can't (nor is expected to) know I'm
doing that.

Example: 

Procedure HiWorld;
Var MyVariable: ansistring;

Begin
  MyVariable:=MyVariable; // this is a workaround in rare cases.
  CallAReferenceProcedure(MyVariable); // This is warning material. 
End;

Note: I know it MAY create a few assembly instructions - but I think I'll
take a couple of them to hush the compiler. 

It seems like a "CLEAN" thing to do... I mean, it raises doubt (speaking for
myself) when I compile something and there are warnings being displayed. It
makes me think the programmer has not addressed everything or my environment
might be the cause of said application to maybe not work as designed.

Jason P Sage

 

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


[fpc-pascal] MySQL4 Pascal Unit

2006-07-26 Thread Jason P Sage
I have tested the FPC supplied MySQL4 unit and I've admittedly haven't had a
ton of time to play with it yet. But I was curious if any of you had any
feedback about it.

I wrote a wrapper for the FPC supplied MySQL3 a long time ago and it worked
awesome. I think I should do the same for MySQL4, and perhaps someone is
working on a MySQL5 unit for FPC now.

So, my questions can be summarized with: If you used the MySQL4 unit in FPC,
do you have any comments you could share?

Thank You,

Jason P Sage
[EMAIL PROTECTED]



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


Re: [fpc-pascal] MySQL4 Pascal Unit

2006-07-26 Thread Michael Van Canneyt


On Wed, 26 Jul 2006, Jason P Sage wrote:

> I have tested the FPC supplied MySQL4 unit and I've admittedly haven't had a
> ton of time to play with it yet. But I was curious if any of you had any
> feedback about it.
> 
> I wrote a wrapper for the FPC supplied MySQL3 a long time ago and it worked
> awesome. I think I should do the same for MySQL4, and perhaps someone is
> working on a MySQL5 unit for FPC now.

The mysql 5 unit has been available since a long time.

> 
> So, my questions can be summarized with: If you used the MySQL4 unit in FPC,
> do you have any comments you could share?

Mysql 3 and 4 are relatively compatible, the only area needing some changes
are the connection routines.

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


[fpc-pascal] CRT (Console Unit) Problems with Fedora 5

2006-07-26 Thread Jason P Sage
Hi, 
It's me again. I was wondering if anyone has run into a problem
where programs that used the CRT unit and have worked for both Linux and
win32 find that these same programs no longer work on newer lynx's?

I have this whole suite of code - literally megs of source code that works
on Win32 and used to work on some older distros of Linux years back. When I
got them to compile in FPC 2, and they ran on Windows, they would not run on
Redhat Fedora 5 Linux.

I did find that I could probably write an old BBS ANSI'ish alternative to
the CRT unit and maybe make the calls pretty compatible or something -
dropping some legacy TERMINFO stuff etc just using escape sequences for
maybe VT400 and Linux console or something. 

(Which my efforts to emulate the CRT calls themselves I've had problems with
- I don't understand all the constructs for some things - but that is me...
and frankly I'd rather use what works(worked) before))

Does anyone know what might be different in current Linux distros that's not
handled like before that might contribute to the CRT unit not working on my
Fedora 5?

A good example is that FreeVision and the FPC IDE do not work on my Linux
either.

Thanks - this one has baffled me for awhile. One solution would be to make a
wrapper to the CRT unit, and depending if I'm Linux or not, use CRT stock
lock and barrel, and use a home made lean terminal emulator for Linux. Does
this sound like a good or bad idea?


Thank You Again!
Jason P Sage

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


Re: [fpc-pascal] Compiler Warning and Notices like unused variables etc.

2006-07-26 Thread Graeme Geldenhuys

  MyVariable:=MyVariable; // this is a workaround in rare cases.


Can anybody that knowns the internals of FPC confirm if this will
create extra work/code for the compiler?  I have been trying for a
long time to figure out a clean way of getting rid of some compiler
warnings.

Regards,
 Graeme.


--
There's no place like 127.0.0.1
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Compiler Warning and Notices like unused variables etc.

2006-07-26 Thread Vinzent Hoefler
On Wednesday 26 July 2006 12:49, Graeme Geldenhuys wrote:

> >   MyVariable:=MyVariable; // this is a workaround in rare cases.
>
> Can anybody that knowns the internals of FPC confirm if this will
> create extra work/code for the compiler?

It does create an assignment. At least with the fpc2.0.2 version I just 
checked:

Compiled with "-al" for source lines and "-O3":

|.Ll2:
|.stabn 68,0,10,.Ll2 - P$TEST_ASSIGN
|# [10] x := x;
|movl-4(%ebp),%eax

Without optimization it even generates:

|.stabn 68,0,10,.Ll2 - P$TEST_ASSIGN
|# [10] x := x;
|movl-4(%ebp),%eax
|movl%eax,-4(%ebp)

Depending on the view point and application it might be negligible. It's 
probably not a good idea to do that inside a tight loop, but in most 
other cases those couple of bytes won't hurt.

Although, well ... I wouldn't depend on that behaviour, because the 
variable still *is* as uninitialized as before, because the right hand 
side of the expression assigned to it is. So if someone cares to write 
code for a more stricter data flow analysis, the warning may at some 
time reappear.

So this is no clean way to do it I'd say.

What is needed is a way to tell the compiler: "Trust me. I know what I'm 
doing."[1] ;)


Vinzent.

[1] "{$SLEDGE_HAMMER ON}"?

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


Re: [fpc-pascal] Compiler Warning and Notices like unused variables etc.

2006-07-26 Thread Michael Van Canneyt


On Wed, 26 Jul 2006, Graeme Geldenhuys wrote:

> > MyVariable:=MyVariable; // this is a workaround in rare cases.
> 
> Can anybody that knowns the internals of FPC confirm if this will
> create extra work/code for the compiler?  

It will.

> I have been trying for a
> long time to figure out a clean way of getting rid of some compiler
> warnings.

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


Re: [fpc-pascal] CRT (Console Unit) Problems with Fedora 5

2006-07-26 Thread Micha Nelissen
Jason P Sage wrote:
> A good example is that FreeVision and the FPC IDE do not work on my Linux
> either.

Elaborate on "do not work" please ?

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


Re: [fpc-pascal] national support

2006-07-26 Thread DarekM

Friš Martin Mgr napisał(a):


I give additional details. I write programs for mathematical 
linguistics. Especially program for frequency dictionary of chosen 
text. I write text to the editor. The text is in Czech. It displays 
correctly in editor window , i.e. with diacritics. Then follows 
transformation into words. In program for frequency diactionary, which 
contains binary search I have usual read and write statements. When I 
send the result to the printer with write it is displayed incorrectly 
on the print output – the diacritics. I am working under Windows |X|P.


What other details should I give for somebody to give me advice.

Martin Fris

-Original Message-
*From:* [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] *On Behalf Of *Friš 
Martin Mgr

*Sent:* Monday, July 10, 2006 2:21 PM
*To:* fpc-pascal@lists.freepascal.org
*Subject:* [fpc-pascal] national support

I am enthusiastic user of Free Pascal. I want ask a question, if there 
in Free Pascal exist the support for national environment. In czech 
there are letters with diacritics. They are not displayed correctly on 
the screen and on the printer. In Windows there is code page 1250 for 
these signs. Is there something in Free pascal?


Martin Fris



Hi
Printing diactrics not depend on FPC only on system and choose code page 
of You.
You can write on printer with the same like on screen. Printer has the 
same canvas. But when You choose font You have to change code page. to 
1250. You can print also in text mode, but then You have to change code 
page manual (its depend on printer). Some times You have to convert text 
form one code page to another (f.e from 8859-2 to 1250 or UTF-8)

Send which method You need, and sample code.


Darek




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


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


[fpc-pascal] Unknown runtime error 202

2006-07-26 Thread Wolfram Kläger
I had this error two or three times these days. I managed to get rid of it by 
moving a local method variable to a field. Example:

class.method
var
 d3 : array[ .., .., ..] of ...
begin
...

Works, if length(d3) < unknown limit. When I get the unknown runtime error 202 
instead,  I rearrange d3 to

... class
private
 Fd3 : array ...

Then it works again. Apparently for unlimited array sizes. But what is the 
secret, where is the limit? And if this secret / limit is known, why the error 
is not?

Regards
Wolfram

P.S. I do love all fpc warnings and hints too. Except [file variable] does not 
seem to be initialized. So far the only situation, where I am used to wrap a 
statement in {$HINTS OFF} .. {$HINTS ON}
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Unknown runtime error 202

2006-07-26 Thread Vinzent Höfler

Wolfram Kläger wrote:

I had this error two or three times these days. I managed to get rid

> of it by moving a local method variable to a field. Example:


class.method
var
 d3 : array[ .., .., ..] of ...
begin
...

Works, if length(d3) < unknown limit. When I get the unknown runtime

> error 202 instead,  I rearrange d3 to


... class
private
 Fd3 : array ...

Then it works again. Apparently for unlimited array sizes. But what is

> the secret, where is the limit? And if this secret / limit is known,
> why the error is not?

Well, I don't know why exactly it is displayed as "Unknown runtime 
error", but I hit that several times myself. Fortunately I still 
remember the good old Turbo Pascal days, where number 202 was a stack 
overflow error, and from my findings - when it happened to my code - it 
still is. Highly recursive routines with a wrong or even missing 
termination condition have never been a good idea. ;)


To answer your question: According to the documentation, the size of the 
local variables (allocated on the stack) should not exceed 32 KiBytes 
for portability reasons. So if you need more, it just depends on how 
much the target architecture is able to supply.


So it's probably a better idea to allocate anything larger than that 
from the heap.



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