[fpc-pascal] Chaining method calls

2020-03-23 Thread Ryan Joseph via fpc-pascal
Is it possible to achieve this dynamically without resorting to type casting? It feels like classes should have a builtin type for each class, like TClassType, which similar to TObject.ClassType but is a compile time type. = {$mode objfpc} program test; type TBase = class // TCl

[fpc-pascal] Range check error warning.

2020-03-23 Thread fredvs via fpc-pascal
Hello. With fpc 3.3.1 there is this warning: "Warning: (4110) Range check error while evaluating constants (-193 must be between 0 and 255)" Here the code pointed by the warning: const foldhiddenbit = 7; foldhiddenmask = 1 shl foldhiddenbit; currentfoldhiddenbit = 6; currentfoldhiddenmask =

[fpc-pascal] Disable Warning: (6060) Case statement does not handle all possible cases

2020-03-23 Thread fredvs via fpc-pascal
Hello. How to disable the Warning: (6060) Case statement does not handle all possible cases ? I did try with this without luck, the warning is still there: interface {$warn 6060 off} Fre;D - Many thanks ;-) -- Sent from: http://free-pascal-general.1045716.n5.nabble.com/ __

Re: [fpc-pascal] Size of pdynarraytypeinfo

2020-03-23 Thread fredvs via fpc-pascal
Super. And I am so happy that the best representative of what fpc can do is still in the game. Thanks Sven. Fre;D - Many thanks ;-) -- Sent from: http://free-pascal-general.1045716.n5.nabble.com/ ___ fpc-pascal maillist - fpc-pascal@lists.free

Re: [fpc-pascal] Size of pdynarraytypeinfo

2020-03-23 Thread Sven Barth via fpc-pascal
fredvs via fpc-pascal schrieb am Mo., 23. März 2020, 22:27: > By the way, may I use this tip for fpc < 3.3.1 or is it ok only with fpc > trunk? > Yes, it will also work with older be versions - as you noticed already. ;) Regards, Sven > ___ fpc-pasca

Re: [fpc-pascal] Size of pdynarraytypeinfo

2020-03-23 Thread fredvs via fpc-pascal
> Time to commit it (but I wait for your green light Sven). I did commit the change because after many tests, I cannot find problems (but if you see a warning or a tip, it is welcome). Many thanks Sven. Fre;D - Many thanks ;-) -- Sent from: http://free-pascal-general.1045716.n5.nabble.c

Re: [fpc-pascal] Size of pdynarraytypeinfo

2020-03-23 Thread fredvs via fpc-pascal
> By the way, may I use this tip for fpc < 3.3.1 or is it ok only with fpc trunk? Ok, I did compile it with FPC 3.0.4, FPC 3.2.0 and FPC 3.3.1. And... ... Yes, all 3 works as expected. ;-) x 1000. Time to commit it (but I wait for your green light Sven). Fre;D - Many thanks ;-) -- S

Re: [fpc-pascal] Size of pdynarraytypeinfo

2020-03-23 Thread fredvs via fpc-pascal
Hello Sven. Always good news with you! OK, I did replace all call to pdynarraytypeinfo with PTypeInfo and adapt all code for this. And you know what: IT WORKS! I am totally surprised but now msestat files are ok with fpc 3.3.1. Well, well, well done Sven (you could not imagine how happy I am).

Re: [fpc-pascal] Size of pdynarraytypeinfo

2020-03-23 Thread Sven Barth via fpc-pascal
Am 23.03.2020 um 17:49 schrieb fredvs via fpc-pascal: Some more infos: This gives the correct size with fpc <= 3.2.0: function dynarrayelesize(const typinfo: pdynarraytypeinfo): sizeint; var ti: pdynarraytypeinfo; begin ti:= typinfo; inc(pointer(ti),ord(pdynarraytypeinfo(ti)^.namelen)+2);

Re: [fpc-pascal] Size of pdynarraytypeinfo

2020-03-23 Thread fredvs via fpc-pascal
Some more infos: This gives the correct size with fpc <= 3.2.0: function dynarrayelesize(const typinfo: pdynarraytypeinfo): sizeint; var ti: pdynarraytypeinfo; begin ti:= typinfo; inc(pointer(ti),ord(pdynarraytypeinfo(ti)^.namelen)+2); result:= psizeint(ti)^; end; But with last trunk fpc 3.

[fpc-pascal] Size of pdynarraytypeinfo

2020-03-23 Thread fredvs via fpc-pascal
Hello. How to do to retrieve the size of the array of pdynarraytypeinfo? Thanks Fre;D - Many thanks ;-) -- Sent from: http://free-pascal-general.1045716.n5.nabble.com/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.fre