[fpc-pascal] Re: Can variables be declared within a block?

2010-10-21 Thread leledumbo

> This argument can be used to promote each and every change, no matter how
obscure it is. 
> But you forget that you may be forced to read code from other people in
> which case you are 
> suddenly confronted with such weird constructs. Then it does not help that
> you had guidelines 
> for your own code. I fail to see this as a relevant argument. 

Agreed. I'm currently working on a PHP project which is coded badly, no
separation between logic and presentation, no database query abstraction,
many html tags embedded as PHP strings, etc. This is an example of a
language that have good coding guidelines (a framework that I use follows it
nicely) but allows bad coding style.

OTOH, almost all Pascal based projects/units/libraries I downloaded from
internet are coded in almost the same good style, maybe some different
indentation, but that could be easily remedied with Lazarus' JCF code
formatting feature. Even though the author is not an advanced Pascal
programmer.

So, putting this as a part of language spec is indeed necessary and a
correct decision.
-- 
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Can-variables-be-declared-within-a-block-tp3211702p3231810.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Can variables be declared within a block?

2010-10-21 Thread Jürgen Hestermann

Rob Kennedy schrieb:
Write that into your local coding guidelines and 
enforce it in code reviews, not the language spec.


This argument can be used to promote each and every change, no matter how 
obscure it is.
But you forget that you may be forced to read code from other people in which case you are 
suddenly confronted with such weird constructs. Then it does not help that you had guidelines 
for your own code. I fail to see this as a relevant argument.


As I see it, Pascals success was just the simple (still powerful) syntax and 
semantic.
I would not like that this is given up by following trends and making Pascal 
the same thicket as C.
And for what reason? Just to save a little typing? I can't see how this 
outwheighs the disadvantage
of obscuring the code.


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


Re: [fpc-pascal] JSON Parser to tree view

2010-10-21 Thread Luiz Americo Pereira Camara

ik escreveu:

Hello,

I wish to use the JSON parser to create some sort of TreeView of my 
JSON (it's more then 500 lines of data).
Before I'll write such code, do you know of any existed code that does 
such thing, or at least most of the work ?



http://code.google.com/p/luipack/source/browse/trunk/vtvextras/vtvutils/vtjson.pas

See demos folder

Requires VTV from 
http://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/virtualtreeview-new


and
LCLExtensioins from http://code.google.com/p/luipack 



Luiz


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


Re: [fpc-pascal] Building FPC with debug information

2010-10-21 Thread Jonas Maebe

On 21 Oct 2010, at 08:24, Graeme Geldenhuys wrote:

> Op 2010-10-20 20:36, Jonas Maebe het geskryf:
>> 
>> On 20 Oct 2010, at 19:54, Brian Winfrey wrote:
>> 
 make OPT="-O-" DEBUG=1 all
>>> 
>>> When I ran this I see that both -dDEBUG and -dRELEASE are passed on
>>> the fpc command line.  Is that correct?
>> 
>> Yes.
> 
> Mind explaining why? DEBUG and RELEASE is known to be opposites, so what do
> you end up with when both defines are specified, a debug build (debug info
> includes) or a release build (stripped version - no debug info)?

A debug build compiled for releasing (e.g., with all units compiled so that the 
compiler will not try recompiling them when it finds a source file with same 
name).


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


[fpc-pascal] PostgreSQL 8.4 Ubuntu 10.10 x64

2010-10-21 Thread Andrew Brunner
I've got a problem with the PostgreSQL component.  I've got an insert
statement with int64 values.  The prepare command goes through but the
server denies the entire packet with the string value of the int64 is
too large for integer type error.

The fields were all declared as bigint and the parameter binding
happened as LargeInt.  This worked on MySQL but I'm sure everything is
working on my end.  Anyone have problems with using Int64 types and
insert?

Report as bug?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: [Lazarus] JSON Parser to tree view

2010-10-21 Thread ik
Thank, that's a great tool, you saved my time and nerves :)

Once again FPC and Lazarus for the rescue.

Ido


On Thu, Oct 21, 2010 at 16:27, Michael Van Canneyt
wrote:

>
>
> On Thu, 21 Oct 2010, ik wrote:
>
>  Hello,
>>
>> I wish to use the JSON parser to create some sort of TreeView of my JSON
>> (it's more then 500 lines of data).
>> Before I'll write such code, do you know of any existed code that does
>> such
>> thing, or at least most of the work ?
>>
>
> See the tools/jsonviewer application in Lazarus. It does exactly that;
> editing and all.
>
> Michael.
>
> --
> ___
> Lazarus mailing list
> laza...@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Re: [Lazarus] JSON Parser to tree view

2010-10-21 Thread Michael Van Canneyt



On Thu, 21 Oct 2010, ik wrote:


Hello,

I wish to use the JSON parser to create some sort of TreeView of my JSON
(it's more then 500 lines of data).
Before I'll write such code, do you know of any existed code that does such
thing, or at least most of the work ?


See the tools/jsonviewer application in Lazarus. It does exactly that;
editing and all.

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


[fpc-pascal] JSON Parser to tree view

2010-10-21 Thread ik
Hello,

I wish to use the JSON parser to create some sort of TreeView of my JSON
(it's more then 500 lines of data).
Before I'll write such code, do you know of any existed code that does such
thing, or at least most of the work ?

Thanks,

Ido


LINESIP websites:
http://www.linesip.com
http://www.linesip.co.il
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Building FPC with debug information

2010-10-21 Thread Henry Vermaak

On 21/10/10 07:24, Graeme Geldenhuys wrote:

Op 2010-10-20 20:36, Jonas Maebe het geskryf:


On 20 Oct 2010, at 19:54, Brian Winfrey wrote:


make OPT="-O-" DEBUG=1 all


When I ran this I see that both -dDEBUG and -dRELEASE are passed on
the fpc command line.  Is that correct?


Yes.


Mind explaining why? DEBUG and RELEASE is known to be opposites, so what do
you end up with when both defines are specified, a debug build (debug info
includes) or a release build (stripped version - no debug info)?


The makefiles always pass RELEASE=1 (iirc).  The later options on the 
command line will override the earlier ones, so OPT gets put somewhere 
at the end.


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


Re: [fpc-pascal] Real length of WideString

2010-10-21 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said:
> 
> Length() returns number of bytes, not number of characters. The incorrect
> assumption was made back in Delphi (before unicode support).

Afaik before unicode.

Delphi 3 (which introduced widestrings) was released August 5th, 1997.

Unicode 3.0 that adds surrogate points was only released in 2000.


Note that there was no other way anyway, since parsing characters for length
would be horribly slow.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] IntList

2010-10-21 Thread Honza
2010/10/19 Brian Winfrey :
> Take a look at http://code.google.com/p/fprb/.  I have just perused
> it, but it looks pretty good.

I'm willing to cooperate (as free time permits) on any required
FPRB/heLib review/modification process would any part(s) of the code
be considered/adopted by the dev team, including but not limited to
(re)releasing the code under a FCL compatible license (currently New
BSD). Just let me know if/what is necessary.

-- 
bflm
freepascal-bits.blogspot.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal