Re: [fpc-pascal]CompareStr

2003-02-13 Thread Michael Van Canneyt


On Thu, 13 Feb 2003, [iso-8859-1] Iván Montes wrote:

> Hi,
>
> Maybe it's how it's supposed to be but if use :
>
> compareStr( 'hello', 'hello-bye' )
>
> I get 0, so they are equal.

In the fixbranch version I get -45 ?

(
version:
Free Pascal Compiler version 1.0.7 [2003/02/03] for i386
)

What version are you using ? I have fixed a bug report about this some
time ago:

  Revision 1.1.2.14  2002/11/28 20:13:10  michael
  + Fixed comparestr

Michael.


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



[fpc-pascal]CPU rel2rev23 uploaded

2003-02-13 Thread Thomas Schatzl
Hi,

  just updated my CPU package to rel2rev23. No breathtaking news, just a
plain simple update:

- added a new field to the TCPUInfo record which contains the number of
logical processors if Hyperthreading enabled (e.g. P4 only).
- bugfixes for Cyrix processor capabilities (hope they're correct now)
- a few new known processor models
- the included platform.inc was completely revised to support much more
platforms (well, FPC added a lot of new platforms since the last update). I
hope I didn't break too much by doing so. Delphi 7 is supported too now
(e.g. cpu unit compiles there as well again =) Ignore the "unsafe code"
warnings.

I wanted to add a contributed Lazarus LCL example - but couldn't because I
seem to have lost the mail folder containing cpu related stuff... :-( Well,
I guess it's not that hard to figure that out...

See included docupd.txt for documentation changes.

Apart from that I think it is slowly time for a cpu rel3 since processor
capabilities of different x86 type CPU vendors (most notable AMD <-> Intel)
are more and more diverging. Current cpu identification internals were
basically designed for Intel compatibility. (rel2 already serves its purpose
quite well imo for nearly three years now... =) Well, the timing stuff won't
be affected by that.

Regards,
  Thomas

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



Re: [fpc-pascal]CPU rel2rev23 uploaded

2003-02-13 Thread Thomas Schatzl
From: "Thomas Schatzl" <[EMAIL PROTECTED]>
Sent: Thursday, February 13, 2003 2:01 PM
Subject: [fpc-pascal]CPU rel2rev23 uploaded

>
> [CPU rel2rev23 update announcement...]
>

As usual forgot to mention the most important thing, the URLs...

http://members.yline.com/~tom_at_work/cpudist.zip for the CPU package (67k
zipped with text docs)
http://members.yline.com/~tom_at_work/index.html for the homepage

Regards,
  Thomas

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



Re: [fpc-pascal]CompareStr

2003-02-13 Thread Iván Montes
- Original Message -
From: "Michael Van Canneyt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 13, 2003 1:59 PM
Subject: Re: [fpc-pascal]CompareStr


What version are you using ? I have fixed a bug report about this some
time ago:

  Revision 1.1.2.14  2002/11/28 20:13:10  michael
  + Fixed comparestr

Michael.

---

I'm using the lastest snapshot of the 1.0 branch,
I've check the CVS for the 1.1 branch and it's fixed, don't know about 1.0
one


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



Re: [fpc-pascal]ExtractFileDir ?

2003-02-13 Thread Iván Montes
- Original Message -
From: "Anton Tichawa" <[EMAIL PROTECTED]>

> So there are two errors:
>
> 1. I decremented below j, but the programmer had in mind that i was above
j.
> the while-statement should read 'while (I > J) ..'
>
> 2. The Copy returns the full string for length 0 -
>
> Note: I don't like the while structure for combined conditions. I prefer a
> repeat-until with several breaks. That usually makes things more clear. I
> know that this is not considered 'well-structured' programming, but the
world
> we live in is not 'well-structured'. Should I post a new, tested "repeat -
> break - break - until" version of this function?
>
my mistake, sorry, hopefully this should work fine

c:\test\ => \test
c:test\ => test
\test => \
c:a => 
c:\ => \
\\Workgroup\server\command.com => \\Workgroup\server

function ExtractFileDir( const FileName :string):string;
var
len, j :integer;
begin
  //Get the filename length
  len := length(FileName);
  //Check if it has defined a drive
  if (len>1) AND (FileName[2]=':') then j:=3
   else j:=1;

  //Find the last directory separator if any
  while (len>=j) AND NOT(FileName[len] in ['\','/']) do Dec(len);
  //Remove the ending slash
  if len>j then dec(len);

  if lenhttp://lists.freepascal.org/mailman/listinfo/fpc-pascal



Re: [fpc-pascal]CompareStr

2003-02-13 Thread Michael Van Canneyt


On Thu, 13 Feb 2003, [iso-8859-1] Iván Montes wrote:

> - Original Message -
> From: "Michael Van Canneyt" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, February 13, 2003 1:59 PM
> Subject: Re: [fpc-pascal]CompareStr
>
>
> What version are you using ? I have fixed a bug report about this some
> time ago:
>
>   Revision 1.1.2.14  2002/11/28 20:13:10  michael
>   + Fixed comparestr
>
> Michael.
>
> ---
>
> I'm using the lastest snapshot of the 1.0 branch,
> I've check the CVS for the 1.1 branch and it's fixed, don't know about 1.0
> one

That is strange, because I explicitly fixed it in the fixbranch,
and the compiler I used has version 1.0.7.. I'll have to do some
more checking, it seems.

Michael.


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



[fpc-pascal]FPC Error! :(

2003-02-13 Thread James Mills
Hi,

What on earth does: schanserv.pas(715) Fatal: Internal error 55665566
mean ?

cheers
James
___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



RE: [fpc-pascal]FPC Error! :(

2003-02-13 Thread Lee, John
This isn't enought info! A bit more info needed eg what version/flavour of
fpc, date, what source are you compiling...Regards John 

-Original Message-
From: James Mills [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 17:21
To: [EMAIL PROTECTED]
Subject: [fpc-pascal]FPC Error! :(


Hi,

What on earth does: schanserv.pas(715) Fatal: Internal error 55665566
mean ?

cheers
James
___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

This e-mail and any attachment is for authorised use by the intended recipient(s) 
only.  It may contain proprietary material, confidential information and/or be subject 
to legal privilege.  It should not be copied, disclosed to, retained or used by, any 
other party.  If you are not an intended recipient then please promptly delete this 
e-mail and any attachment and all copies and inform the sender.  Thank you.
___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



[fpc-pascal]Line Continuation

2003-02-13 Thread Haluk DUMAN



Hi list,
{First excuse my poor english}
What is the "Line Continuation" 
character for FPC ?


From BorlandC++ ::: (((
Using the Backslash (\) 
for Line Continuation
A long token sequence can 
straddle a line by using a backslash (\).
The backslash and the following 
newline are both stripped to provide
the actual token sequence 
used in expansions.
)))


_
Haluk DUMAN
Electric & Electronic 
Engineer
e-mail: 
"DUMAN, Haluk" <[EMAIL PROTECTED]>


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Line Continuation

2003-02-13 Thread Sebastian Günther
Haluk DUMAN schrieb:

Hi list,
{First excuse my poor english}
What is the "Line Continuation" character for FPC ?


there is no "line continuation" in Pascal. You can add a line break at 
arbitrary positions between two consecutive tokens. To split strings, use +:
  'some long string, ' +
  'continued in the second line'


- Sebastian

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Line Continuation

2003-02-13 Thread Marco van de Voort
C[ text/html is unsupported, treating like TEXT/PLAIN ]

> 
> 
> 
> 
> 
> Hi 
>list,
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal



Re: [fpc-pascal]CompareStr

2003-02-13 Thread Iván Montes
Sorry Michael,

I just found out that this happens in the 1.0.6 release version of FPC.
It's fixed with a current snapshot.

Sorry again,
Ivan
___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



Re: [fpc-pascal]CompareStr

2003-02-13 Thread Michał Kamburelis
Hello !

You found a bug : CompareStr( 'hello', 'hello-bye' ) = 0.
It's already fixed in FPC 1.1 and 1.0.7, so I guess you're using FPC 1.0.6
or older. You can switch to FPC 1.0.7 or you can fix this by editing RTL
sources :

At least for FPC 1.0.6, it's in file rtl/objpas/sysstr.inc, lines 109 - 110
:
You should replace these two lines
   if Count1 > Count2 then result := ord(s1[Count1 + 1])
   else result := -ord(s2[Count2 + 1]);
with
   if Count1 > Count2 then result := ord(s1[Count + 1])
   else result := -ord(s2[Count + 1]);
(that is, the "Count1" and "Count2" in array indexes should be replaced
with  "Count").

That's all for THAT bug.
But while reading the code of CompareStr function we can see there's
another bug and it still exists in FPC 1.1 : CompareStr('hello',
'hello'#0'bye') will return 0 ! We can change the code in many ways to
remove this disadvantage or we can state somewhere clearly that CompareStr
doesn't work for strings that include #0 character inside (I myself would
prefer the first option). This problem goes to the developers of FPC RTL.

Sorry for my poor english grammar.
Regards, Michalis Kamburelis
[EMAIL PROTECTED]

--r-e-k-l-a-m-a-


Tanie bilety lotnicze!
http://samoloty.onet.pl
___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



Re: [fpc-pascal]Line Continuation

2003-02-13 Thread James Mills
On Thu, Feb 13, 2003 at 08:39:27PM +0200, Haluk DUMAN wrote:

Never post HTML to the list. Use PlainText.

cheers
James
___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal