--- [EMAIL PROTECTED] wrote:
>
> {$H+}
> or
> {$H-}
>
> definitely works.
Sorry, by does nothing I meant that it does nothing to solve my
problems with strings. Of course, the fundamental problem is that I
don't fully understand anything but old-fashioned TP strings.
[EMAIL PROTECTED] seq-baye
On maandag, jul 14, 2003, at 20:31 Europe/Brussels, Alan Mead wrote:
If there is, I cannot find it. {$H} does nothing and I re-read the
portion of the docs that deal with the sting types again and I don't
see what I'm doing wrong.
There is a difference between longstrings and ansistrings. Ansistri
On Mon, 14 Jul 2003, Alan Mead wrote:
>
> --- James Mills <[EMAIL PROTECTED]> wrote:
> > On Mon, Jul 14, 2003 at 06:48:06AM -0700, Alan Mead wrote:
> > > I'm running into this string problem as well. I'd like to use
> > > strings longer than 255 but I get strange errors like:
> > >
> [...]
>
>
--- James Mills <[EMAIL PROTECTED]> wrote:
> On Mon, Jul 14, 2003 at 06:48:06AM -0700, Alan Mead wrote:
> > I'm running into this string problem as well. I'd like to use
> > strings longer than 255 but I get strange errors like:
> >
[...]
> I believe there is a compiler switch.
If there is, I
On Mon, Jul 14, 2003 at 06:48:06AM -0700, Alan Mead wrote:
> I'm running into this string problem as well. I'd like to use
> strings longer than 255 but I get strange errors like:
>
> [EMAIL PROTECTED] seq-bayes]$ fpc mcmc3pl.pas
> Free Pascal Compiler version 1.0.6 [2002/05/23] for i386
> Copyri
I'm running into this string problem as well. I'd like to use
strings longer than 255 but I get strange errors like:
[EMAIL PROTECTED] seq-bayes]$ fpc mcmc3pl.pas
Free Pascal Compiler version 1.0.6 [2002/05/23] for i386
Copyright (c) 1993-2002 by Florian Klaempfl
Target OS: Linux for i386
Compili
> Yes and no. Why is it so bad to write a function in that way ? It could
> of course be written two different ways, but I'd rather this way where I
> modify the string passed to the function.
>
> Explain it to me :) (I'm the only one that works on this project of
> ~30,000 LOC, so I don't see any
On Sun, Jul 13, 2003 at 09:56:20PM +0100, Matt and Lisa Emson wrote:
> > And yes Matt
> > Emson, I do understand why my original functions weren't working :)
>
> including the part about not passing Strings as var params too? ;-P
Yes and no. Why is it so bad to write a function in that way ? It c
> And yes Matt
> Emson, I do understand why my original functions weren't working :)
including the part about not passing Strings as var params too? ;-P
___
fpc-pascal maillist - [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pasc
On Fri, Jul 11, 2003 at 06:41:22AM -0700, Jeff Pohlmeyer wrote:
> (*
> How about using "set of char" instead of "array of char" ?
> That way, the compiler should be able to distinguish
> between the overloads...
> *)
> program repl;
>
> type
> tSetOfChar = set of char;
>
> procedure repl
> (*
> How about using "set of char" instead of "array of char" ?
> That way, the compiler should be able to distinguish
> between the overloads...
> *)
Yeah, that will work ;-) The only problem would be if he wanted to remove
specific patterns of chars, but I'm guessing this isn't the case.
(*
How about using "set of char" instead of "array of char" ?
That way, the compiler should be able to distinguish
between the overloads...
*)
program repl;
type
tSetOfChar = set of char;
procedure replace(chars: tSetOfChar; const replace: String; var s: String);
var
i: Integer;
begin
On Fri, 11 Jul 2003, Matt Emson wrote:
> > Normally the performance hit is nearly zero.
> > No copying is done, only a reference count is increased. As it is a
> > const, it cannot be assigned to anyway, so there will be no copy-on-
> > write operation.
> >
> > It is always a good idea to use 'C
> Normally the performance hit is nearly zero.
> No copying is done, only a reference count is increased. As it is a
> const, it cannot be assigned to anyway, so there will be no copy-on-
> write operation.
>
> It is always a good idea to use 'Const' parameters as it will stop you
from
> assigning
On Fri, 11 Jul 2003, Matt Emson wrote:
>
> BTW, if you are using longstrings, you shouldn't be passing by reference, as
> the longstring (AnsiString) is already a pointer. If FPC handles memory in a
> similar way to Delphi with respects to longstrings, it may cause a
> performance hit if the str
> Well ok thanks Matt, however I kind of already had this figured out, but
> was posting here to find out if there's a way around it (other than
> naming two separate functions)...
>
> Perhaps there isn't...
James,
only tested in Delphi, but the following would seem to work
procedure repla
On Thu, Jul 10, 2003 at 05:25:21PM +0100, Matt Emson wrote:
> > > procedure replace(search: String; replace: String; var s: String);
> > > procedure replace(const chars: array of char; replace: String; var s:
> String);
> >
> > A string, or a array of char?
>
> James, this (as Marco put it) was ex
> > procedure replace(search: String; replace: String; var s: String);
> > procedure replace(const chars: array of char; replace: String; var s:
String);
>
> A string, or a array of char?
James, this (as Marco put it) was exactly what I had in mind. The compiler
will have to make a decision, and a
On Thu, Jul 10, 2003 at 05:26:31PM +0200, Marco van de Voort wrote:
> > 15 replace(['0'..'9'], w, s);
> > (gdb) s
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > $08066073 in main () at test4.pas:15
> > 15 replace(['0'..'9'], w, s);
> > (gdb)
>
> Passin
> 15 replace(['0'..'9'], w, s);
> (gdb) s
>
> Program received signal SIGSEGV, Segmentation fault.
> $08066073 in main () at test4.pas:15
> 15 replace(['0'..'9'], w, s);
> (gdb)
Passing a set ( ['0'..'9'] ) to
> procedure replace(search: String; replace: String; var s
On Thu, Jul 10, 2003 at 03:58:02PM +0100, Matt Emson wrote:
> James, have you tried using non overloaded function calls?? ie. StrReplace
> and ArrReplace etc. It should take a few minutes to implement, and may yield
> the answer you're seeking.
>
> I still prefer the way Delphi overloads. At least
James, have you tried using non overloaded function calls?? ie. StrReplace
and ArrReplace etc. It should take a few minutes to implement, and may yield
the answer you're seeking.
I still prefer the way Delphi overloads. At least it explicitly implies it
is doing so.
Matt
__
(gdb) break 14
Breakpoint 1 at $806603c: file test4.pas, line 14.
(gdb) run
Starting program: /home/pircsrv/src/test4
Enter a string: [EMAIL PROTECTED]
Replace all digits with ?
Breakpoint 1, main () at test4.pas:14
14 readLn(w);
(gdb) n
X
15 replace(['0'..'9'], w, s);
(g
23 matches
Mail list logo