Re: [fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-22 Thread Howard Page-Clark via fpc-pascal
On 22/04/2022 17:13, Rainer Stratmann via fpc-pascal wrote: Am Freitag, 22. April 2022, 17:27:33 CEST schrieb Hairy Pixels via fpc-pascal: On Apr 22, 2022, at 8:48 PM, Rainer Stratmann via fpc-pascal From assembly to high-level language there is a huge step. From high-level language to

Re: [fpc-pascal] Improved FPC JSON-RPC support

2021-12-29 Thread Howard Page-Clark via fpc-pascal
On 29/12/2021 11:22, wkitty42--- via fpc-pascal wrote: On 12/29/21 4:54 AM, Michael Van Canneyt via fpc-pascal wrote: Translated to RPC: if you want speed, don't use HTTP or JSON. WST offers a binary protocol and plain TCP channel, it's bound to be much faster. i'm sorry... what is WST?

Re: [fpc-pascal] TypeInfo on generic templates

2020-10-29 Thread Howard Page-Clark via fpc-pascal
On 29/10/2020 18:27, Ryan Joseph via fpc-pascal wrote: Is it possible that the TypeInfo intrinsic could work with generic template types or is this a bug? I get "Illegal qualifier" in the procedure below. generic procedure DoThis(a: array of T); begin writeln(TypeInfo(T)^.name); end;

Re: [fpc-pascal] Enum range check error

2020-10-21 Thread Howard Page-Clark via fpc-pascal
On 21/10/2020 21:34, Ryan Joseph via fpc-pascal wrote: I thought default would just return the first value in the enum but I guess it's just zeros. Maybe we need a better default for objfpc mode. The first element is returned by Low(TEnum), and the first value by Ord(Low(TEnum)).

Re: [fpc-pascal] Dynamic Arrays in Procedures

2020-10-04 Thread Howard Page-Clark via fpc-pascal
On 04/10/2020 20:58, James Richters via fpc-pascal wrote: I’m wondering if there is a way to pass an array of values to a Procedure without defining an array variable…. For example, if I have a Procedure: Procedure DoSomething(X :Byte); Then I can call it with a specific a variable like

Re: [fpc-pascal] Range check error warning.

2020-03-25 Thread Howard Page-Clark via fpc-pascal
On 25/03/2020 17:46, wkitt...@windstream.net wrote: On 3/24/20 6:58 PM, Sven Barth via fpc-pascal wrote: wkitt...@windstream.net schrieb am Di., 24. März 2020, 18:37: you should figure out why typed constants are not being allowed/used in your setup... Typed constants can not be used to

Re: [fpc-pascal] Pass open array to static array?

2020-03-15 Thread Howard Page-Clark via fpc-pascal
On 15/03/2020 12:06, Ryan Joseph via fpc-pascal wrote: program test; var data: array[0..2] of integer; begin // Incompatible types: got "{Array Of Const/Constant Open} Array of ShortInt" expected "Array[0..2] Of LongInt" data := [1,2,3]; end. With recent FPCs you can however do this:

Re: [fpc-pascal] Compiler treatment of dotted reference in class property

2020-02-03 Thread Howard Page-Clark via fpc-pascal
On 03/02/2020 13:17, Sven Barth via fpc-pascal wrote: Howard Page-Clark via fpc-pascal <mailto:fpc-pascal@lists.freepascal.org>> schrieb am Mo., 3. Feb. 2020, 11:22: FPC 3.0.4 compiles this code excerpt without a murmur: == code == {$mode objfpc}{$H+} type    T

[fpc-pascal] Compiler treatment of dotted reference in class property

2020-02-03 Thread Howard Page-Clark via fpc-pascal
FPC 3.0.4 compiles this code excerpt without a murmur: == code == {$mode objfpc}{$H+} type   TSheetInfo = record     name: String;     tab: String;     title: String;     kind: TSheetKind; // an enumeration     color: TColor;   end;   TBaseSheet = class(TTabSheet)   protected     FSheetInfo: 

Re: [fpc-pascal] Const attributes

2017-07-30 Thread Howard Page-Clark via fpc-pascal
On 30/07/17 19:55, Marcos Douglas B. Santos wrote: I would like to instantiate my attribute only once inside constructor and then it will be "const" or "final", I mean, immutable. Today it is not possible, right? Any thoughts to the future? It is not what you are asking for, but you can do

Re: [fpc-pascal] Array clearing

2017-04-04 Thread Howard Page-Clark via fpc-pascal
On 04/04/17 05:25, Ryan Joseph wrote: Is it possible use FillChar on a multidimensional arrays? arr: array of array of array of integer. SetLength(arr, 3, 3, 3); FillChar(arr[0], (3*3*3)*sizeof(integer), false); I’m just getting crashes. You can always use FillChar and its kin on specific

[fpc-pascal] IsValidIdent() and identifiers escaped with

2017-02-05 Thread Howard Page-Clark
Consider this program, which returns False: program Project1; uses sysutils; var : boolean; begin :=IsValidIdent(''); WriteLn('IsValidIdent() evaluates to ', ); end. Should sysutils.IsValidIdent() be updated to return True in this case?

Re: [fpc-pascal] How to split file of whitespace separated numbers?

2016-12-23 Thread Howard Page-Clark
On 23/12/16 08:14, Bo Berglund wrote: Is there a quick way to split a string of whitespace separated values into the separate members? It is possible that a custom string parser (something along these lines) might improve your processing speed: type TDoubleArray = array of Double;

Re: [fpc-pascal] Problem with objects

2015-12-23 Thread Howard Page-Clark
On 23/12/2015 11:40, Santiago A. wrote: It's an object, not a class inherited from Tobject, so it hasn't create constructor. Try this: program simpleObjConsole; type { TSimpleArrayString } TSimpleArrayString=object public List:array of String; constructor Init;

Re: [fpc-pascal] How to work with reference-counted strings in dynamically created objects

2015-03-28 Thread Howard Page-Clark
On 28/03/2015 08:31, Sven Barth wrote: Am 28.03.2015 06:51 schrieb Howard Page-Clark h...@talktalk.net mailto:h...@talktalk.net: The following program, compiles and runs as expected using a shortstring declaration in the TExample record. Could someone explain how to adapt it to cope

[fpc-pascal] How to work with reference-counted strings in dynamically created objects

2015-03-27 Thread Howard Page-Clark
The following program, compiles and runs as expected using a shortstring declaration in the TExample record. Could someone explain how to adapt it to cope with a TExample record containing ansistrings? Howard == code == program Project1; {$mode objfpc}{$H+} {$ModeSwitch advancedrecords}

Re: [fpc-pascal] Common class type

2015-03-20 Thread Howard Page-Clark
On 20/03/2015 07:25, Torsten Bonde Christiansen wrote: Hi. Is there method in fpc to find the highest common class-type of two derived classes? I do not know of such a routine, though there may well be one somewhere. I would have said that the highest common class would always be TObject,

Re: [fpc-pascal] character escaping with ^LETTER

2015-01-19 Thread Howard Page-Clark
On 19/01/2015 13:29, Dmitry Boyarintsev wrote: Not sure which pascal its inherited from... but Delphi 7 does compile it too. It was certainly a feature of the first TurboPascal, and perhaps was in even earlier Pascal compilers, enabling simple insertion of control characters from

Re: [fpc-pascal] How can you convert an enum value to string?

2014-12-13 Thread Howard Page-Clark
On 13/12/2014 02:50, silvioprog wrote: ... for i := 1 to c do getenumname(typeinfo(tenum), integer(en)); ... I think for a fairer comparison with WriteStr the compared GetEnumName call should be ... for i := 1 to c do s := GetEnumName(TypeInfo(tenum), integer(en)); ... Mind you, on

Re: [fpc-pascal] else and otherwise in a case statement

2014-12-11 Thread Howard Page-Clark
On 11/12/2014 21:07, Mark Morgan Lloyd wrote: I've been doing a bulk replace of 'case..else' to 'case..otherwise' to eliminate possible ambiguities that have bitten me in the past, and have noticed something interesting under 2.6.4 on x86 Linux. How can else be ambiguous within a case

Re: [fpc-pascal] got untyped expected procedure variable type of procedure(TObject) of object; Register

2014-07-16 Thread Howard Page-Clark
On 15/07/2014 19:56, rupert THURNER wrote: type TForm1 = class(TForm) procedure SpeedButton1Click(Sender: TObject); procedure TForm1.SpeedButton1Click(Sender: TObject); procedure TForm1.CreateButton(t: Integer;l: Integer;btext: String; machine: String); var button: TSpeedButton;

Re: [fpc-pascal] Printing object

2014-06-07 Thread Howard Page-Clark
On 07/06/2014 15:49, Michael Van Canneyt wrote: On Sat, 7 Jun 2014, Krzysztof wrote: Hi, I need to analyze a lot of big objects (a lot of properties, global vars etc). Looking for easy way to print object info in format: TObject Property/VarName = value end; It should also step into

Re: [fpc-pascal] Cloning objects?

2014-03-19 Thread Howard Page-Clark
On 19/03/2014 22:01, Timothy Groves wrote: Is there a drop-dead simple way to clone an object? The convention established in Delphi for TPersistent descendants is to provide an Assign method to do this, so for TPersistent descendants (components, controls etc.) you can just override this

[fpc-pascal] Does RTTI offer any method parameter information?

2014-02-01 Thread Howard Page-Clark
In a situation where PPropInfo^.PropType^.Kind=tkMethod does RTTI enable you to determine the number and/or types of the parameters that method uses (if any)? If not, is there a programmatic way to determine that information apart from parsing the source? Howard

Re: [fpc-pascal] Does RTTI offer any method parameter information?

2014-02-01 Thread Howard Page-Clark
On 01/02/2014 18:54, Sven Barth wrote: On 01.02.2014 19:10, Howard Page-Clark wrote: In a situation where PPropInfo^.PropType^.Kind=tkMethod does RTTI enable you to determine the number and/or types of the parameters that method uses (if any)? Yes, please take a look at the tkMethod part

Re: [fpc-pascal] Pure FPC ?

2014-01-26 Thread Howard Page-Clark
On 26/01/2014 21:20, Fred van Stappen wrote: Does it exist a option to compile fpc without Delphi compatibility ? If no, what do you think about that ? I know, it will be lot of work (like create a Delhi_Compatiblizer class...) but it could be great for people who want a lighter

Re: [fpc-pascal] Strange message about mixed signed expression

2014-01-21 Thread Howard Page-Clark
On 21/01/2014 17:33, Jürgen Hestermann wrote: I always wondered why I get a compiler message for the following code ... if i+length(M)length(F) then ... But where are signed expressions involved? Length is declared in the compiler/RTL to return an integer result. Howard

[fpc-pascal] minor glitch in phrasing of rarely seen compiler warning

2014-01-16 Thread Howard Page-Clark
I recently wrote code that produced this Warning ... Warning: compiler switches aren't supported in \ styled comments Should this not read as follows? Warning: compiler switches aren't supported in / styled comments ___ fpc-pascal maillist -

Re: [fpc-pascal] Documentation, syntax diagrams

2014-01-08 Thread Howard Page-Clark
On 08/01/2014 18:16, Jürgen Hestermann wrote: Today I found this type definition in some FreePascal sources: TypeReal =type Double; I wondered what the second “type” keyword means here (I have never seen this before). You are being rather obtuse. Ignore the diagrams in the docs if they

Re: [fpc-pascal] Documentation, syntax diagrams

2014-01-08 Thread Howard Page-Clark
On 08/01/2014 20:01, Sven Barth wrote: On 08.01.2014 19:40, Howard Page-Clark wrote: On 08/01/2014 18:16, Jürgen Hestermann wrote: Today I found this type definition in some FreePascal sources: TypeReal =type Double; I wondered what the second “type” keyword means here (I have never seen

[fpc-pascal] Over-zealous Warning about dynamic string initialization

2013-11-01 Thread Howard Page-Clark
The following program: program Project1; {$mode objfpc}{$H+} var s:ansistring; begin WriteLn('s ',s,' always seems to be initialized to '); end. produces a Warning Warning: Variable s does not seem to be initialized Can this Warning be disabled for compiler-managed variables?

Re: [fpc-pascal] Breaking Pascal source lines

2013-09-06 Thread Howard Page-Clark
On 06/09/2013 14:10, Mark Morgan Lloyd wrote: I'm sure there isn't a single right answer to this question, but if transferring Pascal source to a system that enforces short lines (e.g. 78 chars + CRLF) what's the best automatic breaking rule? One possibility is obviously to break after the

[fpc-pascal] When does a reference counted object get freed automatically, and when not?

2013-08-10 Thread Howard Page-Clark
I've been exploring interfaces a bit, and fail to understand when automatic destruction of an object is precipitated by the compiler, and when not. Consider the lifetime of the two instances i1 and i2 in the following program. It seems that i2 (called in a method of i1) is freed automatically,

Re: [fpc-pascal] OT: Re: http://www.freepascal.org/future.var

2013-06-06 Thread Howard Page-Clark
On 06/06/2013 08:32, Mark Morgan Lloyd wrote: Reinier Olislagers wrote: On 6-6-2013 7:52, Florian Klämpfl wrote: Reinier Olislagers reinierolislagers-re5jqeeqqe8avxtiumw...@public.gmane.org schrieb: On 5-6-2013 22:02, Florian Klämpfl wrote: I'am opposed to an LLVM backend but if Jonas

Re: [fpc-pascal] Re: two questions about dynamic array

2013-03-14 Thread Howard Page-Clark
On 14/03/13 7:59, Mattias Gaertner wrote: Xiangrong wanted to know if the above array is initialized. If you want to test that then you have to either single step via the debugger or to compare the allocated memory before and after. The problem is that you do not know the memory position before

Re: [fpc-pascal] Re: two questions about dynamic array

2013-03-13 Thread Howard Page-Clark
On 12/03/13 8:30, Xiangrong Fang wrote: TMyClass = class myarray: array[0..100] of Integer; end; You could answer such questions yourself: program Project1; {$mode objfpc} type TMyClass = class myarray: array of Integer; end; var my:TMyClass; begin my:=TMyClass.Create; try

Re: [fpc-pascal] Re: two questions about dynamic array

2013-03-13 Thread Howard Page-Clark
On 13/03/13 9:50, Mattias Gaertner wrote: On Wed, 13 Mar 2013 09:35:43 + Howard Page-Clark h...@talktalk.net wrote: On 12/03/13 8:30, Xiangrong Fang wrote: TMyClass = class myarray: array[0..100] of Integer; end; You could answer such questions yourself: Not with this simple test

Re: [fpc-pascal] Set size limit

2013-03-10 Thread Howard Page-Clark
On 10/03/13 2:12, Jonas Maebe wrote: There is a already a test for larger set support: http://svn.freepascal.org/svn/fpc/trunk/tests/test/tset6.pp Nobody has worked yet on implementing it, but if anyone thinks it's easy to do, please go ahead. For larger sets, especially if they are sparse,

Re: [fpc-pascal] Result: string

2013-03-05 Thread Howard Page-Clark
On 04/03/13 10:33, José Mejuto wrote: The code that makes me wonder something is wrong is this one: --- {$mode objfpc} {$h+} procedure TheB(var aTheA: string); begin aTheA:=aTheA+'A'; end; function TheA(): string; begin //Result:=''; TheB(Result);

Re: [fpc-pascal] Result: string

2013-03-04 Thread Howard Page-Clark
On 04/03/13 8:23, Juha Manninen wrote: On Mon, Mar 4, 2013 at 9:21 PM, José Mejuto joshy...@gmail.com wrote: What's the expected output of this code ? function TheA(): string; begin Result:=Result+'A'; end; writeln(TheA()); I thought that when the result type is an automated one its value

Re: [fpc-pascal] fpc registry unit

2013-03-01 Thread Howard Page-Clark
On 01/03/13 5:34, John Lee wrote: Think I'm missing something! I need the/a fpc registry unit - I can't seem to find it on svn - lots of references to it! Pls send or point me to it. If you use Lazarus, just make sure FCL is a declared dependency in your project, and add uses registry; to

Re: [fpc-pascal] FPC Lazarus used for teaching down under

2013-02-28 Thread Howard Page-Clark
On 28/02/13 12:19, Marcos Douglas wrote: Very good! But I'm afraid if someone thinking if Pascal is just for kids 5-9 years old... not here, but out there! :) Thank you for share it. Year 5-9 kids refers to their school year, not their calendar age. In the UK a Year 9 teenager is 13 or 14

[fpc-pascal] abstract classes

2013-01-20 Thread Howard Page-Clark
FPC allows the Delphi-compatible class abstract syntax, but does not seem to prevent instantiation of such a class. The following code compiles and runs satisfactorily (FPC version 2.6.0) Does trunk prevent this compiling? program Project1; {$mode objfpc}{$H+} type TAbstractClass = class

Re: [fpc-pascal] class destructor not recognised

2013-01-07 Thread Howard Page-Clark
On 07/1/13 2:42, Paul Ishenin wrote: You don't understand. Class destructor is called automatically like finalization section of a unit. You can't call it directly. Thanks for the clarification. I was confused by the fact that the writeln called in the class destructor is not displayed. But

[fpc-pascal] class destructor not recognised

2013-01-06 Thread Howard Page-Clark
The following program compiles and gives output as expected, but if the lines that call the class destructor are uncommented it fails to compile with the error identifier idents no member Finalise program classConstructor; {$mode objfpc} uses Classes; type TXClass = class

[fpc-pascal] Codetools and C-style constructs

2012-12-18 Thread Howard Page-Clark
Looking through some of the codetools sources makes me wonder if the codetools overlooks some C-style FPC operators. KeywordFuncLists.pas, for instance, seems not to know about , , +=, -=, *=, /=. Or are these operators are catered for elsewhere in the codetools? Howard

Re: [fpc-pascal] Codetools and C-style constructs

2012-12-18 Thread Howard Page-Clark
On 18/12/12 10:56, Mattias Gaertner wrote: Looking through some of the codetools sources makes me wonder if the codetools overlooks some C-style FPC operators. KeywordFuncLists.pas, for instance, seems not to know about , , +=, -=, *=, /=. I added the and . The others are assignment

Re: [fpc-pascal] Property alias

2012-12-07 Thread Howard Page-Clark
On 07/12/12 2:50, Krzysztof wrote: Hi, Interfaces can have aliases for functions: Function MyOtherFunction : Integer; Function IMyInterface.MyFunc = MyOtherFunction; Can normal object have aliases for properties? For example, TControl.Caption. I would like to publish this property

[fpc-pascal] Case of documentation

2012-11-24 Thread Howard Page-Clark
Describing the Case statement The FPLanguageReference.pdf 10.2.2 says: The constants appearing in the various case parts must be known at compile-time, and can be of the following types : enumeration types, Ordinal types (except boolean), and chars. Why the except boolean? I find the

Re: [fpc-pascal] Is it possible to redefine FreePascal types?

2012-11-21 Thread Howard Page-Clark
On 21/11/12 7:49, Kenneth Cochran wrote: Yes. type newString = type string; Any function that accepts newString as a parameter will cause a compilation error if you try to pass a normal string. You'll have to cast it to newString first. This is not the case, as the following program

Re: [fpc-pascal] releasing commercial components as PPU files

2012-10-22 Thread Howard Page-Clark
On 22/10/12 3:17, Graeme Geldenhuys wrote: On 2012-10-22 14:59, Vincent Snijders wrote: I am more optimistic than Michael. Because the same source is used, the CRC is the same and no recompile is done. Thanks Vincent, things are looking better and better. You might be interested to follow

Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Howard Page-Clark
On 14/9/12 2:43, Mattias Gaertner wrote: c: set of Char = ['','',':','','/','\','|','?','*', '%', '.']; But several of those are fine in filenames- just inadvisable since they need special quoting/escaping to get past the shell. As does ' ' which isn't in your list :-) And it does

Re: [fpc-pascal] WeekDay outdated?

2012-08-13 Thread Howard Page-Clark
On 13/8/12 9:56, Jürgen Hestermann wrote: I am not able to use this function: http://www.freepascal.org/docs-html/rtl/dos/weekday.html nor can I find it in the sources. Does it still exist? If yes, how to use it? Which unit? DOS does not work. You will find what you need at unit dateutils.

Re: [fpc-pascal] How to find a graphic element in the form editor?

2012-08-07 Thread Howard Page-Clark
On 07/8/12 1:10, Jürgen Hestermann wrote: When I want to add a graphic element like TFileNameEdit which I have already used in other programs in the form editor I don't know how to find it in the menu. Although this is the fpc list you mention a LCL component and the form editor, so I presume

[fpc-pascal] /docs-html/rtl/system/get_caller_addr.html

2012-08-07 Thread Howard Page-Clark
There is a typo in this documentation. The Description field refers to get_caller_frame when get_caller_addr is surely meant. Howard ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: printing each Friday the 13 using Pascal

2012-08-06 Thread Howard Page-Clark
On 06/8/12 1:32, leledumbo wrote: Minor amendment needed to leledumbo's code to give Friday, and a five year range: uses SysUtils; const startYr: word = 2012; var dt: TDateTime; year, month: word; begin for year in [0..4] do for month in [1..12] do begin dt :=

Re: [fpc-pascal] Get all caller adresses of a procedure/function

2012-08-06 Thread Howard Page-Clark
On 06/8/12 3:26, Rainer Stratmann wrote: procedure p1; begin ... end; How to get all caller adresses of p1 in a program before p1 is executed? For example p1 is called from 20 different places in a program. Then I need the 20 caller adresses. if by address you mean line number, then use

Re: [fpc-pascal] Program without window but messages

2012-04-24 Thread Howard Page-Clark
On 24/4/12 5:25, Jürgen Hestermann wrote: I wanted to write a program that has no window but may show messages to the user. I have lots of such programs written with Virtual Pascal but I am struggling to do the same with Free Pascal/Lazarus. A simple test program would look like this:

Re: [fpc-pascal] XML parser

2012-04-07 Thread Howard Page-Clark
On 06/4/12 7:38, Juha Manninen wrote: Now I am looking for a proper XML parser for Delphi, for big XML files. The default Delphi parser, using MS DOM, chokes badly. 4 GB memory is not enough for it. Another option is kbmMW from http://www.components4programmers.com/products/index.htm The

Re: [fpc-pascal] (no subject)

2012-02-24 Thread Howard Page-Clark
On 23/2/12 4:17, Everton Vieira wrote: Is there any plans to implement public procedures/function of a class that can be used without been necessary to create the class? I presume you know about class methods such as TObject's class function ClassName : shortstring; that you can use like

Re: [fpc-pascal] Pass array of record as parameter

2012-02-09 Thread Howard Page-Clark
On 09/2/12 5:17, Zaher Dirkey wrote: Hi, TInfo=record s: string; i: integer; end; function func1(a: array of TInfo); how can i pass the parameter to that function? You have to declare the parameter type independently of the function declaration. You can also do it without declaring

Re: [fpc-pascal] procedure variable and inc/dec procedures

2012-01-17 Thread Howard Page-Clark
On 17/1/12 9:47, ik wrote: var a : procedure(var x : TOrdinal); b : procedure(var x : integer); begin a := @inc; b := @dec; Why doesn't the compiler like the above code ? Inc and Dec are internal compiler routines, more like macros than true functions. They are not coded as

Re: [fpc-pascal] fpGUI Toolkit v0.8 release for FPC 2.4.4 2.6.0-rc

2012-01-05 Thread Howard Page-Clark
On 05/1/12 8:37, Graeme Geldenhuys wrote: Thanks Paul. I'm almost ready to push the new website live. I'll make sure I update your embedded section. Regarding your previous message about documentation. My goal this year is to complete the API documentation, and also start writing a free

Re: [fpc-pascal] alias a function + overload 'in'

2011-12-18 Thread Howard Page-Clark
On 18/12/11 5:07, David Emerson wrote: 1. Is it possible to make an alias to a function ... so rather than just re-calling with the same parameters, it's actually the same thing? like the way we can do, e.g., type natural = cardinal, or const GG = 6, but with a function? There's always the

Re: [fpc-pascal] video unit and pseudo-graphic characters on Windows

2011-07-04 Thread Howard Page-Clark
On 04/7/11 7:16, Calinov Valentin wrote: Hi, I need to display pseudo-graphic characters on Windows XP (English version) using video unit from fpc-2.4.4 . When I use Raster Fonts they are displayed correctly but when I use Lucida Console font, small squares are displayed instead. The current

Re: [fpc-pascal] Initialize object variables

2011-04-28 Thread Howard Page-Clark
On 28/4/11 10:00, Jürgen Hestermann wrote: Darius Blaszyk schrieb: Is there any way to initialize object variables, other than writing an init method? So something like: myobj = object myvar: word = $; end; I don't think so. An object is a pointer to a data structure on the heap. At

Re: [fpc-pascal] Pre-initialising a TStringList

2011-02-06 Thread Howard Page-Clark
On 06/2/11 1:55, Mark Morgan Lloyd wrote: Given one or more lines of text which are known at compilation time, and without the requirement to internationalize (these are, by RFC, US ASCII), what is the best way to get them into a TStringList? Perhaps there are better ways than the

Re: [fpc-pascal] Re: [Lazarus] complex ini like syntax parser

2011-01-06 Thread Howard Page-Clark
On 06/1/11 2:49, Gene Buckle wrote: On Wed, 5 Jan 2011, leledumbo wrote: If you want something fast, pyacc and plex distributed with fpc can be an option. But I suggest writing your own since that way you'll have a full control of its features. Is there an fpc version of TIniFile? g.

Re: [fpc-pascal] constant records as default parameters

2010-12-30 Thread Howard Page-Clark
On 30/12/10 7:40, David Emerson wrote: I'd like to use a constant record as a default parameter. Is there some way to do this? Here's my use case: type lt_ints = record left, top : longint; end; const lt_zero : lt_ints = (left:0; top:0); procedure do_something (const offset_lt

Re: [fpc-pascal] evaluation of set constant

2010-12-22 Thread Howard Page-Clark
On 22/12/10 1:15, Torsten Bonde Christiansen wrote: type TMyType = (a, b, c ,d); TMyTypes = set of TMyTypes; const SetX:TMyTypes = (a, b); SetY:TMyTypes = (c, d); SetCombined: TMyTypes = SetX + SetY; // this gives me an Error: Illegal expression Because you

Re: [fpc-pascal] newbie questions

2010-04-19 Thread Howard Page-Clark
On 19/4/10 3:50, spir ☣ wrote: Hello, Total Pascal newbie here. Looked for answers in various references and tutorials, but cannot find. Fore-question: Is there a (free)pascal teaching/learning mailing list? (Like python's tutor list.) If not, is this one a proper place? * How does one

Re: [fpc-pascal] newbie questions

2010-04-19 Thread Howard Page-Clark
Does this mean that to be able to define a literal value like byteset := [0, 3, 101] for a set (and probably for an array) I must have defined a custom type for it; correct? (It's the only difference I see with my trials: numbers in my code is not of a custom type but simply a var of type

Re: [fpc-pascal] Error: Illegal qualifier in converting Delphi unit

2010-03-15 Thread Howard Page-Clark
On 14/3/10 11:52, Frank Church wrote: Your suggestion worked - what is the secret? Does the array[0..0 have some relevance here?] On 14 March 2010 23:01, Howard Page-Clarkh...@talktalk.net wrote: On 14/3/10 6:11, Frank Church wrote: Hi guys, I am trying to compile the TVersionInfo

Re: [fpc-pascal] Error: Illegal qualifier in converting Delphi unit

2010-03-14 Thread Howard Page-Clark
On 14/3/10 6:11, Frank Church wrote: Hi guys, I am trying to compile the TVersionInfo component by Anders Melander at http://melander.dk/articles/versioninfo/. It defines the structure below type TTranslationRec = packed record case Integer of 0: ( LanguageID: WORD;

Re: [fpc-pascal] readonly variables

2009-11-28 Thread Howard Page-Clark
On Sat, 28 Nov 2009 15:07:42 +0100 Mattias Gaertner nc-gaert...@netcologne.de wrote: On Sat, 28 Nov 2009 14:58:26 +0100 Jürgen Hestermann juergen.hesterm...@gmx.de wrote: is it possible to set a variable in a programm as a readonly variable? Use the following: property MyVar: integer

Re: [fpc-pascal] readonly variables

2009-11-28 Thread Howard Page-Clark
On Sat, 28 Nov 2009 12:10:48 -0500 Anthony Walter sys...@gmail.com wrote: procedure InitMyVariable(Value: T); function MyVariable: T; implementation var PrivateMyVariable: T; PrivateMyVariableSet: Boolean; procedure InitMyVariable(Value: T); begin if not PrivateMyVariableSet

Re: [fpc-pascal] Using TFileStream class

2009-03-04 Thread Howard Page-Clark
On Wed, 4 Mar 2009 20:42:14 +0100 Aurélie de LUCA aureliedel...@gmail.com wrote: Hy everybody, I'm trying to use the TFileStream class to read a file with a record, and I obtain this message when I execute my application : Access violation. You can find my code in the following : type

Re: [fpc-pascal] Re: Using TSdfDataset

2008-09-06 Thread Howard Page-Clark
Felipe Monteiro de Carvalho wrote: Here is my database file: ID,NAMEEN,NAMEPT,HEIGHT,WIDTH,PINS,DRAWINGCODE 1,resistor,resistor,1,1,1,LINE 2,capacitor,capacitor,1,1,1,LINE When listing the value of the NAMEEN field it will show: NAMEEN, resistor, resistor (yes, resistor again!) The correct