2013/10/25 Michael Van Canneyt mich...@freepascal.org
Why not simply make it a procedure that is called by ver-2 and ver-3.
If it cannot be called directly from external code, and will called only
from inside a visible consructor, there is simply no reason to make this
procedure a
2013/10/25 Michael Van Canneyt mich...@freepascal.org
Why not simply make it a procedure that is called by ver-2 and ver-3.
If it cannot be called directly from external code, and will called only
from inside a visible consructor, there is simply no reason to make this
procedure a
Hi,
First of all, I did some research and found this:
http://free-pascal-general.1045716.n5.nabble.com/Compiler-Warning-Constructor-should-be-public-td2825747.html
But that did not convince me. So here is my situation and question.
I have the following case:
TBase = class
public
constructor
2013/9/30 Sven Barth pascaldra...@googlemail.com
However, this does not work, because it seems that I cannot make any
generic method virtual! In TIntTree, I have to write:
function TIntTree.DoClone: TIntTree;
As it is not possible to write TTree outside of the generic definition.
This
2013/9/28 Sven Barth pascaldra...@googlemail.com
On second sight your solution is not correct, because you are using Clone
inside your parent class which would not use the (non-virtual) Clone you
created.
What If I make Clone virtual? If by adding virtual to Clone, the problem
is solved,
2013/9/29 Sven Barth pascaldra...@googlemail.com
If you want to override the virtual Clone method of TTreeLongInt in
TIntTree you need to use the same result type + override or otherwise you
gain nothing, because the compiler will not consider the method as
overloaded and use the Clone
Hi There,
While playing with generics (ref. class inheritance and type
incompatibility), I have an idea to use generic class helper to overcome
the problem that generic methods cannot be virtual (because the compiler
see specialized class different than the generic one?)
I have a TTree generic
2013/9/28 Sven Barth pascaldra...@googlemail.com
On second sight your solution is not correct, because you are using Clone
inside your parent class which would not use the (non-virtual) Clone you
created.
I've now played around with 2.6.2 myself and this should solve this
problem:
===
Hi Sven,
2013/9/26 Sven Barth pascaldra...@googlemail.com
As you can see you are constructing a TTreeInteger class inside
TTreeInteger.Clone and nothing in the world afterwards can turn it into a
TTreeInt.
Do you mean that casting TTreeInteger into TTreeInt is not possible
because this is
Hi All,
I have the following program:
1 program test;
2 {$mode objfpc}{$H+}
3 uses tree;
4 type
5 TIntTree = class(specialize TTreeInteger)
6 public
7 function Clone: TIntTree;
8 end;
9 function TIntTree.Clone: TIntTree;
10 begin
11 Result := TIntTree(inherited
2013/9/26 Xiangrong Fang xrf...@gmail.com
Which output:
TIntTree
TIntTree.TTree$LongInt
Forgot to ask, I understand that TTree$LongInt is the name the compiler
gave to the generic class when it is specialized, but what is
TIntTree.TTree$LongInt? What is the meaning of Scoped type (or type
What should work is the following (now with generics again):
=== code begin ===
type
TTreeT = class
private type
TSelfClass = class of TTree;
public
function Clone: TTree;
end;
function TTree.Clone: TTree;
begin
Result := TSelfClass(Self.ClassType).**Create(Data,
2013/9/26 Sven Barth pascaldra...@googlemail.com
After change to this code in Clone(), I got this error:
tree.pas(66,60) Error: Incompatible type for arg no. 2: Got
TIntTree.TTree$LongInt, expected TTree
Seems like a bug in 2.6.x. It's compiling in 2.7.1.
I altered the code so
Hi There,
If you declare this:
procedure proc(param: array of const);
Then you can pass any type of varaible to param, however, only in an array,
such as proc([1, 2]);
Is it possible to achieve the effect of the code below (which is wrong):
procedure proc(p1: const; p2: const);
So that: 1)
.
This is a trivial problem, I can just go with array of const, I am just
curious if pascal can do this, because it will make the function definition
more strict and my code cleaner.
Regards,
Xiangrong
2013/9/24 Michael Van Canneyt mich...@freepascal.org
On Tue, 24 Sep 2013, Xiangrong Fang wrote:
Hi
Hi All,
say, I have a class TTreeT; in the destructor of that class, is it
possible to know the actual type of T? I want to do things like:
generic TTreeT = class
public
Data: T;
destructor Destroy; override;
end;
destructor TTree.Destroy;
begin
... ...
if Data is TObject then
But it's not a good idea as you'd still need to convert Data to a TObject
(e.g. by using a cast), but that will fail if Data is something else than a
pointer-like type...
This worked in my TTree class (destructor):
if PTypeInfo(TypeInfo(Data))^.Kind = tkObject then TObject(Data).Free;
I
Hi Sven,
2013/9/23 Xiangrong Fang xrf...@gmail.com
Short answer: you can't. The same would happen with normal classes.
Long answer: You could add an additional method Next to your TIntTree
which returns a TIntTree and just do Result := TIntTree(inherited
Next); there.
I still have
2013/9/24 Sven Barth pascaldra...@googlemail.com
How is PNode declared? What is the exact error?
PNode is declared inside TTreap generic class, the source is here:
https://github.com/xrfang/fpcollection/blob/master/src/units/treap.pas
The exact error is:
Error: Incompatible types: got
I know it is same but why no error on the line:
for n in sm1.reversed...
regards.
在 2013-9-24 下午11:23,Sven Barth pascaldra...@googlemail.com写道:
Am 24.09.2013 17:14, schrieb Xiangrong Fang:
2013/9/24 Sven Barth pascaldra...@googlemail.com
How is PNode declared? What is the exact error
Hi There,
I wonder what is the byte alignment of a NON-packed record? Is it always
4-byte, or 4-byte on 32-bit platform, 8-byte or 64-bit platform?
Regards,
Xiangrong
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
Short answer: you can't. The same would happen with normal classes.
Long answer: You could add an additional method Next to your TIntTree
which returns a TIntTree and just do Result := TIntTree(inherited
Next); there.
Why are you subclassing in this case anyway?
Thanks, I will inherit the
Have you tried to pass options to the linker using -k?
That worked, thanks.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Hi All,
I need to use a C++ so file in FreePascal. I have written a C wrapper for
it, which successfully connected to Pascal.
Now my question is, can I use the $linklib directive to link the C-Wrapper
STATICALLY, which in-turn use the shared so file? I tried to do this but
it complained a
, Xiangrong Fang wrote:
Hi All,
I need to use a C++ so file in FreePascal. I have written a C wrapper
for it, which successfully connected to Pascal.
Now my question is, can I use the $linklib directive to link the
C-Wrapper STATICALLY, which in-turn use the shared so file? I tried to do
1) Did you give the correct name ? 2) Is the current dir in the linker
search path ? AFAIK the current dir is by default not in the linker search
path.
I am sure the name is correct. No matter I supply the linker path (-Fl.)
or not, it does not work (i.e. ld reported cannot find
Hi All,
I use $linklib to link my fpc program with a C++ so file. I found that
the $linklib directive does NOT conform with ld specification. This is
what I did and found:
PURPOSE
I want to link to a C library that does NOT start with lib prefix. The
library's name is thostmduserapi.so
Hi All,
I am writing pascal wrapper for a C library called CTP, which is used in
future trading. My project is here:
https://github.com/xrfang/CTPas
Compiling the interface file along is successful. While linking, fpc
complains:
./thostmduserapi.so, needed by ./libthost.so, not found (try
where is thostmduserapi.so ?
Michael.
This file is under libthost folder, I copied it to pasintf folder then use
fpc to compile demo.pas.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
I think you should try to pass the name of the folder where libthost is to
the linker.
-FL/path/to/libthost
Michael.
This does not work, same error message. I also tried to copy libthost.so
to current dir, but leave thostmduserapi.so in ../libthost, same result.
Regards,
Xiangrong
My question is, since the programmer is responsible for explicitly call
object constructors, then why do we need constructors at all? In another
word, what's the difference
between an object constructor and an object method?
Using the constructor tells the compiler that it should allocate
Hi All,
Could anyone please explain this:
5.4 Constructors and destructors
http://www.freepascal.org/docs-html/ref/ref.html#QQ2-64-77 As can be
seen in the syntax diagram for an object declaration, Free Pascal supports
constructors and destructors. The programmer is responsible for calling the
TSelfType worked like a charm. Thanks!
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Hi All,
Where can I find detailed documentation on IFPObserved? This page only
defines the interface but not telling about the purpose of this interface:
http://www.freepascal.org/docs-html/rtl/classes/ifpobserved.html
My questions are:
- what is this interface for?
- any example on when and
is not compatible with Delphi?
5) I am very interested in your CD-Cover designer. please send me the
article and code.
Thank you!
2013/9/11 Michael Van Canneyt mich...@freepascal.org
On Wed, 11 Sep 2013, Xiangrong Fang wrote:
Hi All,
Where can I find detailed documentation on IFPObserved
Hi Michael,
3) What are Live Binding? What's the difference between IFPObserved
and the component events like OnCreate, OnShow, OnClick...?
See IFPObserved as a general event mechanism.
The main difference is that a component can have only 1 OnCreate handler.
whereas, in theory, an
/x86_64-linux -Fu.
-FUlib/x86_64-linux/ -l project1.lpr
However if I remove these -F, it is OK:
fpc -MObjFPC -Scghi -O1 -g -gl -vewnhi -l project1.lpr
Is this a bug in the compiler? I attached the complete source (3 files) so
that you can test it.
Thanks a lot!
2013/9/11 Xiangrong Fang xrf
Hi,
I am writing a Tree class which have the following skeleton:
generic TTreeT = class
private
FItems: TList;
public
...
end;
The FItems variable is used to store Children of current node. My question
is:
Shall I store TTree in FItems or @TTree? My understanding is:
If a variable obj
Hi,
Missing -T is not the problem, the problem is undefined reference,
which caused fatal error.
I filed a bug report: http://bugs.freepascal.org/view.php?id=25001
I am pretty sure this is a bug, becuase while I continue to add code to my
TTree class, this problem is gone! In another word, it
Hi Sven,
Additional note: The PTree = ^TTree in front of the TTree is wrong and
only supported by pre-2.7.1 FPC by accident. The correct code would be:
I removed PTree yesterday and this problem is gone. I now understand that
it is not necessary to define PTree as TTree is a pointer anyway.
Hi Sven,
I have downloaded fpcbuild.zip and did 'NOGDB=1 make build', as it tell me
cannot find libgdb.a...
Now my question is how can I install the binaries so that it does NOT
interfere with my current 2.6.2 build?
Thanks!
___
fpc-pascal maillist -
Hi All,
I have this generic class:
type
generic TTreeT = class
private
FItems: TList;
... ...
public
Data: T;
... ...
function FirstChild: TTree;
... ...
end;
function TTree.FirstChild: TTree;
begin
if FItems.Count = 0 then Exit(nil);
Exit(TTree(FItems[0]));
Hi There,
I try to write a procedure with generic parameters, but failed:
type
generic TArrayT = array of T;
procedure ProcessArray(arr: TArrayT);
begin
end;
The compiler said Generics without specialization cannot be used...
But if I specialize the parameter then this procedure is
this:
var
proc_ints: specialize ProcessArrayLongInt;
begin
proc_ints(someintarray);
end;
use it without explicit specialize is best, however.
2013/9/4 Sven Barth pascaldra...@googlemail.com
Am 04.09.2013 08:18, schrieb Xiangrong Fang:
Hi There,
I try to write a procedure with generic
in delphi mode?btw, my
last experience with Delphi is 6 or 7, there was no generics yet.
Thanks
2013/9/4 Sven Barth pascaldra...@googlemail.com
Am 04.09.2013 09:13, schrieb Xiangrong Fang:
Thanks. This is sort-of too verbose when use. I have no comments
about how to define
Hi there,
I would like to use TVarRec as Variants, after some googling I found this:
http://stackoverflow.com/questions/3733640/how-to-convert-between-tvarrec-and-variant
However, it generated Runtime error 217. My original code (runs OK) is:
1 program test;
2 {$mode objfpc}{$H+}
3
I found the problem myself. You have to add uses Variants to eliminate
the problem. So now my questions are:
1) why the Variants unit is required? What does it do?
2) is there any performance penalty using Variant than TVarRec?
Thanks!
2013/9/5 Xiangrong Fang xrf...@gmail.com
Hi
On 20/08/2013 02:44, Xiangrong Fang wrote:
Hi All,
I am reading this document:
http://www.freepascal.org/docs-html/ref/refsu29.html and doing an
experiment with the following code:
program project1;
{$mode objfpc}{$H+}
type
TBase = class
constructor Create; virtual;
end
is an instantiated class.
You are aware that the link mentioned by Xiangrong Fang points to a
part of the manual about Turbo Pascal style objects which are different in
a different sense to Delphi style objects/classes?
Yes, but as he posts a question in a FPC list I imagine he is looking
Hi All,
I am reading this document:
http://www.freepascal.org/docs-html/ref/refsu29.html and doing an
experiment with the following code:
program project1;
{$mode objfpc}{$H+}
type
TBase = class
constructor Create; virtual;
end;
TDerived = class(TBase)
constructor Create;
classes,
is there any difference here?
Shannon
2013/8/20 Flávio Etrusco flavio.etru...@gmail.com
On Mon, Aug 19, 2013 at 10:44 PM, Xiangrong Fang xrf...@gmail.com wrote:
Hi All,
I am reading this document:
http://www.freepascal.org/docs-html/ref/refsu29.html and doing an
experiment
Hello,
Is there any built-in general Tree data structure in FPC/Lazarus library?
General means:
1) it is a generic class or its node is a pointer which is suitable for
general use
2) it is NOT balanced tree or binary tree, but just like a file system tree.
In another word, I am looking for a
Hi All,
I am writing a redis client in fpc and found that even when the connection
is closed by server (via redis CLIENT KILL), send and receive can still be
done without error. i.e.:
- fpsend returns the number of bytes sent
- fprecv returns 0 (but NOT -1, which indicate a detectable error,
2013/4/22 Marco van de Voort mar...@stack.nl
In our previous episode, Xiangrong Fang said:
I am writing a redis client in fpc and found that even when the
connection
is closed by server (via redis CLIENT KILL),
I don't know the redis protocol is, but CLIENT KILL sounds like redis
2013/4/22 Michael Schnell mschn...@lumino.de
As long as no event happens to one of the sites, the socket is esteemed
connected by this site. This does not mean that the other site thinks the
same
OK, as connection status is a complex issue, I try to put it in another
way:
1) fpsend() just
2013/4/19 Michael Van Canneyt mich...@freepascal.org
1. I don't know whether I have to MANUALLY free memory for these strings to
prevent leak?
Yes, if you work like this, you must do all that. You must free all
pointers in the list, and the strings they point to.
But why not use
Hi All,
I'm studying how pascal manages strings. I wrote a simple test program:
program stringtest;
{$mode objfpc}{$H+}
uses Classes, sysutils;
function test: PString;
var
s : string;
begin
New(Result);
Result^ := FloatToStr(Random);
// s := FloatToStr(Random);
// Result := @s;
end;
var
AM, Xiangrong Fang wrote:
How can I set the connection and read/write timeout when using socket
in free pascal?
I seem to remember that synapse can do this.
Only in svn and it does it this way
if FConnectionTimeout 0 then
begin
// connect in non-blocking mode
b := NonBlockMode
mode
(which I
don't use).
For MSG_DONTWAIT as far I know you have to change to the nonblocking mode.
2013/4/16 Luca Olivetti l...@ventoso.org
Al 16/04/13 12:20, En/na Michael Schnell ha escrit:
On 04/16/2013 11:26 AM, Xiangrong Fang wrote:
How can I set the connection
Hi All,
I am trying to write a tcp client (redis) in free pascal, and found this
function marked as deprecated:
Function Connect(Sock:longint;const addr:TInetSockAddr;var
SockIn,SockOut:text):Boolean; deprecated;
My question is, why it is deprecated, or, what is the replacement for this
Yes, I read the source code and found that fpconnect + socktotext =
connect, but just don't know why combining them together is a bad idea :-)
thanks
2013/4/16 Victor Campillo victor.campi...@gmail.com
On 16/04/13 11:12, Xiangrong Fang wrote:
Hi All,
I am trying to write a tcp client
using the socket like read/write file is very convenient. This is the
first time I use fpc to write socket program, it is much easier than I used
Indy or ICS in Delphi several years ago.
I hope to modernize or make it more stable, instead of deprecate it. Of
course deprecate Connect and use
Hi,
In the following program:
program worksheet;
{$mode objfpc}{$H+}
type
TWorksheet = packed object
private
FProp: string[5];
//FProp: Integer;
public
property Prop: ShortString read FProp;
//property Prop: Integer read FProp;
end;
begin
end.
I got an error while
2013/4/3 Marco van de Voort mar...@stack.nl
Shortstring, is an alias for shortstring[255] the maximum size. Use getters
and setters if you want to make this work.
Thanks, however, I am just defining getter. So, to make this work, I need
to define things like:
type
MyProp = string[5];
It's because in Pascal you need to declare types first.
But why array[0..10] of Integer, or string[255] are not types? Remember
that you can use open array in function params anyway.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
No, there is no difference, because even if we would implement support for
function based operators we would not implement any default ones or only
provide them with an additional unit. So you either need to implement them
yourself or use an additional unit anyway.
I mean, with the proposed
2013/3/29 Sven Barth pascaldra...@googlemail.com
There was already a discussion some time ago whether we should allow
operators like or= and such as well and the result was simple: no. I
consider this the same here.
You can achieve a similar effect through type helpers in 2.7.1 though:
We are now several decades later, but for compatibility reasons the FPU
on the x86 processors still uses the same logic. It is possible to get the
exception at the place
where it happened by inserting fwait instructions after every fpu
operation. Those tell the cpu to stop executing until the
if (Rank = 0) or (Anchor Key) then Rank += 1; -- error here
Result := nil;
end;
It seems that the += operator is not supported anymore?? Is there any
switches in the new 2.7.1?
2013/3/23 Sven Barth pascaldra...@googlemail.com
On 23.03.2013 03:35, Xiangrong Fang wrote:
Hi Sven,
My unite
types: got TTreap$2$crc94C56373
expected TRoller
demo2.lpr(98) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
2013/3/24 Sven Barth pascaldra...@googlemail.com
On 23.03.2013 14:51, Xiangrong Fang wrote:
I got this error now:
treap.pas(311,48) Error: Illegal
2013/3/22 Sven Barth pascaldra...@googlemail.com
The problem is gone, because PNode is not a generic class, but only a
record. However, the following errors are generated:
2.6.x does not support nested types in generics. Generic fixes and
improvements are only found in 2.7.1 as most of
I didn't see a DEB package for 2.7.1. I am currently using 2.6.0. Can I
compile 2.7.1 from source with 2.6.0?
2013/3/22 Sven Barth pascaldra...@googlemail.com
Am 22.03.2013 08:13, schrieb Xiangrong Fang:
2013/3/22 Sven Barth pascaldra...@googlemail.com
The problem is gone, because PNode
Hi Sven,
My unite uses contnrs unit, how can I instruct the compiler to use the
contnrs unit (also the Classes and sysutils units) of v2.7.1? I have
already built 2.7.1 and now try to compile my program in the fpc source dir
as you told.
Thanks
2013/3/22 Xiangrong Fang xrf...@gmail.com
I
On Thu, 21 Mar 2013 11:11:49 +0800
Xiangrong Fang xrf...@gmail.com wrote:
Hi,
I would like to add enumerator support for my TTreap implementation (
https://github.com/xrfang/fpcollection/blob/master/src/units/treap.pas).
The tree nodes are defined as:
PNode = ^TNode;
TNode
I was told that it will be possible in 2.7...
If you like, take a look at my TTreap class, which can be used as a hash
table:
https://github.com/xrfang/fpcollection/blob/master/src/units/treap.pas
2013/3/21 S. Fisher expandaf...@yahoo.com
Is there any way to iterate over a TFPDataHashTable ?
Hi There,
I encountered a problem writing enumerator for my generic tree. The
enumerator class looks like this:
TTreapEnumerator = class
FStack: TStack;
FCurrent: TTreap.PNode;
public
constructor Create(ANode: TTreap.PNode);
destructor Destroy; override;
function
Hi,
I try to do exactly the same as show here:
QUOTE:
http://svn.freepascal.org/svn/fpc/trunk/packages/fcl-stl/src/gvector.pp
generic TVectorT = class
... ...
type
TVectorEnumerator = class
private
FVector: TVector;
FPosition: SizeUInt;
FFirstDone: Boolean;
MKey: Char;
Max: Integer;
constructor Create; override;
end;
I think there is no need to define TTreapEnumerator in THistogram again,
right?
Xiangrong
2013/3/22 Xiangrong Fang xrf...@gmail.com
Hi,
I try to do exactly the same as show here:
QUOTE:
http://svn.freepascal.org
Hi,
I would like to add enumerator support for my TTreap implementation (
https://github.com/xrfang/fpcollection/blob/master/src/units/treap.pas).
The tree nodes are defined as:
PNode = ^TNode;
TNode = record
Count: Cardinal;
Key: TKey;
Value: TValue;
Xiangrong Fang xrf...@gmail.com:
OK, I see. However I feel = a very un-pascal thing, remind me of
PHP. :-) I guess as would also complicate the parser?
As already written by others: as is one of the worst tokens you can
choose for this, as it is perfectly legal to do a typecast in an expression
2013/3/18 Marco van de Voort mar...@stack.nl
In our previous episode, Xiangrong Fang said:
Alternatively, how about just use SPACE to separate the token? i.e.:
with SomeObject o1, SomeOtherObject o2 do
That's perfectly fine for C. But this isn't C.
What's wrong here? In pascal, we
2013/3/18 Marco van de Voort mar...@stack.nl
In our previous episode, Xiangrong Fang said:
In our previous episode, Xiangrong Fang said:
Alternatively, how about just use SPACE to separate the token? i.e.:
with SomeObject o1, SomeOtherObject o2 do
That's perfectly fine
2013/3/18 leledumbo leledumbo_c...@yahoo.co.id
I cannot recall if there is already a notion of alias in free pascal,
if
not then we just introduce this idea within the scope of with expression.
Let me give you one then:
procedure p; [public, alias: 'my_p'];
Is it related to COM or DLL
The AS syntax bites already existing syntax.
May I know what's the existing syntax?
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
I am sorry I didn't follow this thread although I am the OP :-). If I
understand correct, I would suggest NOT introduce the absolute keyword,
instead, make it ALWAYS absolute. i.e.:
with a = SomeObject, b = SomeRecord do begin
... ...
end;
Both a and b are reference to the object or record,
OK, I see. However I feel = a very un-pascal thing, remind me of PHP.
:-) I guess as would also complicate the parser?
2013/3/18 Paul Ishenin paul.ishe...@gmail.com
18.03.13, 9:27, Xiangrong Fang пишет:
I am sorry I didn't follow this thread although I am the OP :-). If
I understand
Suppose I have the following class:
type
TMyClass = class
public
property Caption: string read FCaption write FCaption;
property Items[Index: Integer]: string read GetItem write SetItem;
default;
function Count: Integer;
end;
I would like to do this:
with MyClassInstance as
16.03.2013 07:14 schrieb Xiangrong Fang xrf...@gmail.com:
Suppose I have the following class:
type
TMyClass = class
public
property Caption: string read FCaption write FCaption;
property Items[Index: Integer]: string read GetItem write SetItem;
default;
function Count: Integer
Sorry, the email was interrupted, but sent by the phone in background...
So the decision of this feature is that it is not worth to add, right?
Thanks.
2013/3/16 Xiangrong Fang xrf...@gmail.com
In my example, you can use Items[], but in my real project it is a record
with
发送自魅族MX
shiruba shir...@galapagossoftware.com's example is better than mine, and
was exactly the reason I posted this suggestion.
I don't think a class helper is worth for this stuff, if I need to write a
helper I would rather do this:
longobj := BigLongThingIDontWantToWriteOutEverySingleTime;
With
I don't know what's make it complex if there are 2 or more subject in
the with?
Context. A conflict case the two object were of the same class.
Are you saying this case:
with MyClassInstance1 as m, MyClassInstance2 do begin
m.Property1 := 123;
Property2 := 456;
end;
Here you don't
Also widestrings are not refcounted on the pascal level, but managed.
What's the implication of the difference between refcounted vs. managed?
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
Thanks for the explanation. Now I see why my program some time crashed at
gtk2*.inc...
2013/3/14 Martin laza...@mfriebe.de
On 14/03/2013 09:47, Jonas Maebe wrote:
On 14 Mar 2013, at 01:48, Xiangrong Fang wrote:
The document said it is deprecated? Also, I want this to be cross
platform
Hi All,
I have two simple questions:
1) As far as I know class variables in FPC are automatic initialize to the
NULL value (e.g. 0 or or whatever), does that include dynamic arrays?
e.g.
TMyClass = class
myarray: array[0..100] of Integer;
end;
will myarray be initialized to nil?
2)
Sorry the array should be dynamic, without [0..100].
2013/3/12 Xiangrong Fang xrf...@gmail.com
Hi All,
I have two simple questions:
1) As far as I know class variables in FPC are automatic initialize to the
NULL value (e.g. 0 or or whatever), does that include dynamic arrays?
e.g
Hi There,
Is it possible for class helpers to be selective? i.e. attach to a
specific object of that class, but not every instance? This would be
useful for behavior injection.
Thanks
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
Yes, in that case it will be Nil (Note: in the static case the elements of
the array would be 0).
So, it is even OK to use SetLength() on static arrays? interesting.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
2013/3/13 Sven Barth pascaldra...@googlemail.com
Am 13.03.2013 10:08 schrieb Xiangrong Fang xrf...@gmail.com:
2) After SetLength(myarray, 0), is myarray nil or pointing to some
invalid address?
It will be Nil. An equivalent alternative would be:
MyArray := Nil;
Sorry, I didn't see
Is it possible to use try...except to catch SIGSEGV?
Thanks!
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
The document said it is deprecated? Also, I want this to be cross
platform, not for unix only. The use case is:
try
buf := GetMemory(1024);
size := 10240;
stream.Read(buf^, size);
except
??
end;
2013/3/14 Ewald ew...@yellowcouch.org
Once upon a time, Xiangrong Fang said
101 - 200 of 203 matches
Mail list logo