[fpc-pascal] How to contribute a Unit

2024-02-03 Thread Amir--- via fpc-pascal
Hi,   In www.freepascal.org, I see there is a "Contributed Units" tab. What are the criteria for a unit to be qualified to be placed there. How can one build a community account? Best, Amir P.S. Here <https://github.com/AmirAavani/ParamManager> is the unit I wa

Re: [fpc-pascal] Read Field names from VMT

2024-02-01 Thread Amir--- via fpc-pascal
I see... The trick was to define TMyClass! Thanks! On 2/1/24 02:19, Michael Van Canneyt via fpc-pascal wrote: On Wed, 31 Jan 2024, Amir--- via fpc-pascal wrote: Without more info (declaration of ChildTClass, declaration of the constructor of that class etc), it is not possible to

Re: [fpc-pascal] Read Field names from VMT

2024-01-31 Thread Amir--- via fpc-pascal
Without more info (declaration of ChildTClass, declaration of the constructor of that class etc), it is not possible to comment. We need a complete compilable code sample to provide you with more insight. Please have a look at the attachment. Best, Amir FieldAddress.lpr.gz Description

Re: [fpc-pascal] Read Field names from VMT

2024-01-29 Thread Amir--- via fpc-pascal
; Looks like "ChildTClass.ClassName" is correct but the constructor of the appropriate class is not being called. On 1/22/24 23:05, Michael Van Canneyt via fpc-pascal wrote: On Mon, 22 Jan 2024, Amir--- via fpc-pascal wrote:   Params := TParams.Create;   WriteLn(Params.Int2.IntVal);

Re: [fpc-pascal] Read Field names from VMT

2024-01-22 Thread Amir--- via fpc-pascal
On 1/22/24 23:05, Michael Van Canneyt via fpc-pascal wrote: On Mon, 22 Jan 2024, Amir--- via fpc-pascal wrote:   Params := TParams.Create;   WriteLn(Params.Int2.IntVal);   WriteLn(TInteger(Params.FieldAddress('Int2')).IntVal); The third line does not work (the zipped code i

Re: [fpc-pascal] Read Field names from VMT

2024-01-22 Thread Amir--- via fpc-pascal
  Params := TParams.Create;   WriteLn(Params.Int2.IntVal);   WriteLn(TInteger(Params.FieldAddress('Int2')).IntVal); The third line does not work (the zipped code is attached). On 1/21/24 23:43, Michael Van Canneyt via fpc-pascal wrote: On Sun, 21 Jan 2024, Amir--- via fpc-pascal wr

Re: [fpc-pascal] Read Field names from VMT

2024-01-21 Thread Amir--- via fpc-pascal
How can I set the value? I tried something like Test := TTest.Create Ptr := Pointer(Test); TSub(Ptr+8) := TSub.Create; But it is not working? You can use the PVmtFieldTable and PVmtFieldEntry types from the TypInfo unit: === code begin === program tfield; {$mode objfpc}{$H+} uses   TypInf

Re: [fpc-pascal] How to avoid Copy

2024-01-02 Thread Amir--- via fpc-pascal
Thanks! On 1/2/24 22:59, Sven Barth via fpc-pascal wrote: Amir--- via fpc-pascal schrieb am Mi., 3. Jan. 2024, 07:53: Yeap! That is actually what I posted here (Feature Request) <https://gitlab.com/freepascal.org/fpc/source/-/issues/40578>. My example allows you to access it

Re: [fpc-pascal] How to avoid Copy

2024-01-02 Thread Amir--- via fpc-pascal
Yeap! That is actually what I posted here (Feature Request) .  You simply need to inherit from the list class so that you can make the function public. And with a little trick you can also use it inside a for-in-loop: === code begi

Re: [fpc-pascal] How to avoid Copy

2023-12-31 Thread Amir--- via fpc-pascal
On 12/31/23 02:46, Marco van de Voort via fpc-pascal wrote: Op 31/12/2023 om 04:11 schreef Amir--- via fpc-pascal: I compiled the code with `fpc -O3 -Sd -gv -g -gl ` and ran `valgrind` on it (the output is attached). It does not look like there is a big difference between the Check1 and

Re: [fpc-pascal] How to avoid Copy

2023-12-29 Thread Amir via fpc-pascal
On Dec 29, 2023 9:50 PM, Adriaan van Os wrote:Amir--- via fpc-pascal wrote: > Hi all, > >  I have a List of record, where the record has a WideString field. >   I have some code like the following: > > function check(constref v: TMyRecord; data: TListOfMyRecord): Boolean; > var >   r: TM

[fpc-pascal] How to avoid Copy

2023-12-29 Thread Amir--- via fpc-pascal
PointerToMyRecord. This requires a "lot" of memory allocation/fragmentation. Is there a better solution? Best, Amir ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Read Field names from VMT

2023-12-27 Thread Amir via fpc-pascal
Thank you!On Dec 27, 2023 7:46 AM, Sven Barth via fpc-pascal wrote: Am 26.12.2023 um 21:29 schrieb Amir--- via fpc-pascal: On 12/26/23 01:14, Sven Barth via fpc-pascal wrote

Re: [fpc-pascal] Read Field names from VMT

2023-12-26 Thread Amir--- via fpc-pascal
On 12/26/23 01:14, Sven Barth via fpc-pascal wrote: Amir--- via fpc-pascal schrieb am Di., 26. Dez. 2023, 07:03: Hi,    I want to retrieve the name of the fields in a record/class, at run time. It looks like "TVmt.vFieldTable" is what I need. But I cannot fi

[fpc-pascal] Read Field names from VMT

2023-12-25 Thread Amir--- via fpc-pascal
Hi,   I want to retrieve the name of the fields in a record/class, at run time. It looks like "TVmt.vFieldTable" is what I need. But I cannot find any documentation about how to explore the content of this table. I appreciate any pointer. Thank

Re: [fpc-pascal] I'm working on automated Help Output for console apps

2020-11-20 Thread Amir via fpc-pascal
AnsiString = ('--InputFile:AnsiString', '--Debug:Boolean'); ValidArgumentsValues : array of AnsiString = ('', 'True'); The second array, ValidArgumentsValue (which should be renamed to DefaultValues) set the default values, if none provided. Amir On 11/20/20 2:38 AM, B

Re: [fpc-pascal] Vehicle Routing Problem with Time Windows

2016-07-22 Thread Amir
in polynomial time (just search scholar.google.com). It looks like Wikipedia listed a couple of open source/free software for solving this problem. Amir On 07/22/2016 06:14 AM, Dimitrios Chr. Ioannidis wrote: Hi, does anyone knows any object pascal or c ( not c++, java, lisp

Re: [fpc-pascal] Does Anybody Know how to REALLY kill an App on Pocket Pc?

2009-08-23 Thread amir
why don't you use "Application.Terminate;"? On 08/23/2009 04:21 PM, epergola wrote: Thanks Henry. But my main form is full screen: no title bar, no task bar. I have a custom'Terminate' button that on click does this: MainForm.Close. I want the form to be closed (NOT appearing on the background)

Re: [fpc-pascal] TCP Server

2006-08-18 Thread Amir Aavani
They are in Lib folder. I myself once tried the synapse but I could not figure it out. What you want to do is not a hard one, I have written some programs in this style all using Indy. >> Why indy? You may use fpc unit "sockets" for it. May be because of OOP (at least about Ind

Re: [fpc-pascal] TCP Server

2006-08-17 Thread Amir Aavani
I Installed on Linux(FC4/5). I followed the instruction from http://wiki.lazarus.freepascal.org/index.php/Indy_with_Lazarus. with some changes. Try it! Fabrício F. Kammer wrote: Hi Amir, I tried, but I couldn't install it on my freepascal/lazarus. Can you help with this installation

Re: [fpc-pascal] TCP Server

2006-08-17 Thread Amir Aavani
Do you tried Indy component? I used them in both graphical and console application. It is straight forward. If you need any sample I will be glad Yours, Amir Fabrício F. Kammer wrote: Hi all, I need to developer an application to act as a tcp server that be compatible with windows/linux

[fpc-pascal] Visual Component In lazarus

2005-12-22 Thread Amir Aavani
dear friends, I want to develop a visual component in Lazarus,something like TButton, TLabel or so. Is there any manual, example or . Yours Amir, ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman