Re: [fpc-devel] Format with zero padding

2006-06-20 Thread Marco van de Voort
> Marco van de Voort wrote:
> >>> SysUtils.Format ('%.4D', Some_Int);
> >> Sounds like I found a case where 'C' is more intuitive than pascal ;-).
> > 
> > With a C mindset, yes. There a leading 0 can have meaning. In Pascal an
> > extra leading zero never has meaning.
> 
> It's a formatting string, not a number only. You think a digit *after*
> the decimal point to be used for integers in front of the whole number
> is more intuitive ?

Perfect? no. Better than leading 0? yes.

Leading zeroes that have meaning are an artificial construct. Keep in mind
that C users might be aware of deviant use (they are octal numbers as
literals), but Pascal users most probably wouldn't think twice.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Format with zero padding

2006-06-20 Thread Micha Nelissen
Marco van de Voort wrote:
>>> SysUtils.Format ('%.4D', Some_Int);
>> Sounds like I found a case where 'C' is more intuitive than pascal ;-).
> 
> With a C mindset, yes. There a leading 0 can have meaning. In Pascal an
> extra leading zero never has meaning.

It's a formatting string, not a number only. You think a digit *after*
the decimal point to be used for integers in front of the whole number
is more intuitive ?

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


Re: [fpc-devel] Format with zero padding

2006-06-20 Thread Marco van de Voort
> > 
> > SysUtils.Format ('%.4D', Some_Int);
> 
> Sounds like I found a case where 'C' is more intuitive than pascal ;-).

With a C mindset, yes. There a leading 0 can have meaning. In Pascal an
extra leading zero never has meaning.
 
> Seriously, isn't "Format" an imitation of C's printf ? At least they are
> very similar, but on this detail (and maybe some others as well) they
> are different.

Yeah. Ah well, maybe in C07 that will be fixed.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Format with zero padding

2006-06-20 Thread Vinzent Hoefler
On Tuesday 20 June 2006 11:39, Micha Nelissen wrote:
> Vinzent Hoefler wrote:
> > On Tuesday 20 June 2006 10:44, Micha Nelissen wrote:
> >> How can I zero-pad using Format ?
> >
> > RTFM. :-)
> >
> > SysUtils.Format ('%.4D', Some_Int);
>
> Sounds like I found a case where 'C' is more intuitive than pascal
> ;-).

As if format strings were intuitive at all. :-)

I'd call "Zero_Pad (Some_Int, 4)" definitely more intuitive.

> Seriously, isn't "Format" an imitation of C's printf ?

Apart from the fact, that you can get run time type checking? Yeah, I 
suppose so.

> At least they
> are very similar, but on this detail (and maybe some others as well)
> they are different.

Well, let's assume it's due to Delphi-compatibility. Probably Borland 
decided to do it differently just for the fun of it. ;-)


Vinzent.

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


[fpc-devel] I can not build Lazarus with gtk2

2006-06-20 Thread J. Peter Mugaas
I was compiling Lazarus with gtk2 (I have gtk2.8.17)  in Linux and I got the 
following errors when linking:
-===
/usr/lib/fpc/2.1.1/units/i386-linux/gtk2/gtk2.o: In function 
`GTK2_GTK_TYPE_FILE_CHOOSER_DEFAULT$$LONGWORD':
gtk2.pas:(.text+0xb9b1): undefined reference to 
`_gtk_file_chooser_default_get_type'
/usr/lib/fpc/2.1.1/units/i386-linux/gtk2/gtk2.o: In function 
`GTK2_GTK_TYPE_FILE_CHOOSER_EMBED$$LONGWORD':
gtk2.pas:(.text+0xba11): undefined reference to 
`_gtk_file_chooser_embed_get_type'
/usr/lib/fpc/2.1.1/units/i386-linux/gtk2/gtk2.o: In function 
`GTK2_GTK_TYPE_FILE_CHOOSER_ENTRY$$LONGWORD':
gtk2.pas:(.text+0xba91): undefined reference to 
`_gtk_file_chooser_entry_get_type'
lazarus.pp(113,1) Error: Error while linking
make[2]: *** [lazarus] Error 1
TMessagesView.CollectLineParts WARNING: 20<>13 SrcLine=make[2]: *** [lazarus] 
Error 1
TExternalToolList.Run Exception: make[2]: *** [lazarus] Error 1
===
I did look further and I found that I did not have the following files in my 
/usr/include directory:

gtkfilechooserembed.h
gtkfilechooserentry.h
gtkfilechooserdefault.h

The only place I have them is in my "/src/debug/gtk+-2.8.18/gtk/" directory.  I 
suspect that gtk2 does NOT expose those functions at all.  The corresponding 
.pas files are probably there just in case the gtk developers expose those 
symbols.
--
Support the anti-Spam amendment - Join at http://www.cauce.org/
J. Peter Mugaas, [EMAIL PROTECTED] on 6/20/2006
http://wvnvm.wvnet.edu/~oma00215/  ICQ Number:  14297043
Finger for PGP Key
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Format with zero padding

2006-06-20 Thread Micha Nelissen
Vinzent Hoefler wrote:
> On Tuesday 20 June 2006 10:44, Micha Nelissen wrote:
> 
>> How can I zero-pad using Format ?
> 
> RTFM. :-)
> 
> SysUtils.Format ('%.4D', Some_Int);

Sounds like I found a case where 'C' is more intuitive than pascal ;-).

Seriously, isn't "Format" an imitation of C's printf ? At least they are
very similar, but on this detail (and maybe some others as well) they
are different.

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


Re: [fpc-devel] Format with zero padding

2006-06-20 Thread Micha Nelissen
Michael Van Canneyt wrote:
> 
> in fpc it's a dot.
> 
> Try
> %.4d
> 
> This is in the docs:
> http://www.freepascal.org/docs-html/rtl/sysutils/format.html

Thanks, that works.

I did read that page, but only saw 'padded with spaces' and assumed
Precision was only applicable to floating point values, as it's "after
the dot".

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


Re: [fpc-devel] Format with zero padding

2006-06-20 Thread Vinzent Hoefler
On Tuesday 20 June 2006 10:44, Micha Nelissen wrote:

> How can I zero-pad using Format ?

RTFM. :-)

SysUtils.Format ('%.4D', Some_Int);


Vinzent.

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


Re: [fpc-devel] Format with zero padding

2006-06-20 Thread Michael Van Canneyt



On Tue, 20 Jun 2006, Micha Nelissen wrote:


Hi,

How can I zero-pad using Format ? In C, using printf it's done using an
extra 0 digit in for the width: '%04d' with parameter 3 will print
'0003'. Wouldn't this be useful for FPC's Format as well, or is there
another way ?


in fpc it's a dot.

Try
%.4d

This is in the docs:
http://www.freepascal.org/docs-html/rtl/sysutils/format.html

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


[fpc-devel] Format with zero padding

2006-06-20 Thread Micha Nelissen
Hi,

How can I zero-pad using Format ? In C, using printf it's done using an
extra 0 digit in for the width: '%04d' with parameter 3 will print
'0003'. Wouldn't this be useful for FPC's Format as well, or is there
another way ?

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


[fpc-devel] Back on-line

2006-06-20 Thread Daniël Mantione
Hello all,

The mailinglists are back on-line.

Daniël___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel