Re: [fpc-pascal] with statement using mulltiple objects
On Sat, 13 Sep 2014 20:29:32 +0100 "vfclists ." wrote: >[...] > What then is the nesting for if the command will only apply to the last > item with the property? The compiler searches the identifier in the last With, then in the second last With, ..., then in the local variables, then in the parameters and so forth. > Is each nested element supposed to be a property of > the enclosing element? > > What is the rationale for such a statement, ie using multliple elements? Less typing. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] with statement using mulltiple objects
On Sun, 14 Sep 2014 11:58:22 +0200 Jürgen Hestermann wrote: > Am 2014-09-13 22:31, schrieb Marius: > > Mattias Gaertner wrote: > > All seasoned programmers know that and try to avoid the with statement. The quote is from Marius, not from me. > Realy? I love it. Consider these two varianst of code from one of my programs: > > - > with TreeRoot.SubDirs[Low(TreeRoot.SubDirs)]^ do > begin > DirLogged := true; > DirHatFocus := false; > SubDirsExpanded := true; >[...] > - and - d:=TreeRoot.SubDirs[Low(TreeRoot.SubDirs)]; // local var d d^.DirLogged := true; d^.DirHatFocus := false; d^.SubDirsExpanded := true; [...] - Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] with statement using mulltiple objects
On Tue, 16 Sep 2014 07:26:24 -0300 Philippe wrote: > > > could the compiler avoid "with" pitfalls? > > now the compiler attach > a property to the closest "with" where it finds it. > > the compiler could > check if the property appears in another "with" of the "with" stack and > produce a message (hint, warning or error, which may be configurated). > > > is not it a way to make the "with" safe? How to get rid of the hint? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] ReadXMLFile in fcl-xml package
On Thu, 18 Sep 2014 09:43:21 +0200 LacaK wrote: > Hi, > I use ReadXMLFile from fcl-xml package to read XML file in UTF-8 encoding. > Then I parse Nodes and use TextContent property which is string in > system encoding ... but I need it in UTF-8 encoding. > So I use again UTF8Encode(Node.TextContent). > Is there any SIMPLE way how to say that ReadXMLFile should not perform > translation from UTF-8 to system encoding? > (may be somehow with custom TDecoder or so ... or use Laz_ versions or ...?) The Lazarus sources contain units to read/write XML using UTF8 strings. The units are based on the fcl-xml units. The widestrings were replaced with UTF8 Ansistrings. lazarus/components/lazutils/laz2_xml*. The units work standalone. You don't need Lazarus for them. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PostMessage vs. QueueAsyncCall
On Fri, 19 Sep 2014 17:20:27 +0800 Xiangrong Fang wrote: >[...] > My question is, why cannot Lazarus just use PostMessage, but invent the > QueueAsyncCall() method? What is the rationale, or, why PostMessage is > considered windows-ish (read: not fit into LCL very well?), apart from the > fact that it is a Windows API? Please ask Lazarus question on the Lazarus lists. PostMessage is a WinAPI function that sends an uint, and two pointer sized integers to a Windows Handle with a queue, even to another process. See here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms644944%28v=vs.85%29.aspx The LCL emulates some parts of PostMessage on other widget sets. TApplication.QueueAsyncCall on the other side allows to call a method in the main thread with an optional data pointer. And the call can be removed from the queue. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Hack for C-like macro functions — will it work in future?
On Wed, 24 Sep 2014 07:12:44 -0300 Philippe wrote: > > > -OoREMOVEEMPTYPROCS > > interesting! > > why is it not available in > Lazarus through "all options" window (in project options / customizable > options)? It is available under Compiler Options / Other / All Options You need fpc 2.7.1 for this. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Free Pascal Directories
On Wed, 1 Oct 2014 13:39:39 -0700 (PDT) Brian wrote: > Sorry , I wasn't specific about my problem. Using the example in the fpGUI > distribution (but the following comments are not specific to fpGUI). > > I want to use Geany as the IDE without using .CFG files and compiling from > the commandline. > > If UNITPATH is set in the main program (the fpGUI is a good example) , it > will fail to find fpg_base > helloworld.pas(27,3) Fatal: Can't find unit fpg_base used by HelloWorld > > program HelloWorld; > > {$mode objfpc}{$H+} > > {$UNITPATH .../fpgui/fpgui-1.2/src/units/i386-linux} You can give this directive multiple times to add all needed paths. Or you can pass the unit paths via -Fu in Geany. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Free Pascal Directories
On Wed, 1 Oct 2014 15:16:13 -0700 (PDT) Brian wrote: >[...] > > Do you have an example of how you can pass the unit paths via -Fu in Geany > > ? If you don't know how to do this in Geany, maybe it is not a good editor choice for you. You use the command line from the terminal: fpc -Fufpgui/fpgui-1.2/src/units/i386-linux -Fu... yourprogram.pas And put it into the build commands. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Free Pascal Directories
On Thu, 2 Oct 2014 18:40:01 -0300 silvioprog wrote: >[...] > But it would be an nice feature in Free Pascal, something like the "import" > of Python and Java. =) Java requires a CLASSPATH for the imports to work, does it not? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Lazarus 1.2.6 Release
The Lazarus team is glad to announce the release of Lazarus 1.2.6. This release was built with fpc 2.6.4. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org http://wiki.lazarus.freepascal.org/Lazarus_1.2_fixes_branch#Fixes_for_1.2.6_.28Merged.29 http://wiki.lazarus.freepascal.org/User_Changes_2.6.4 On Windows the installer now allows 2 independent installations. http://wiki.lazarus.freepascal.org/Multiple_Lazarus#Installation_of_multiple_Lazarus The release is available for download on SourceForge: http://sourceforge.net/projects/lazarus/files/ Choose your CPU, OS, distro and then the "Lazarus 1.2.6" directory. Windows x64 users: please use the 32 bit installer if possible. See http://wiki.lazarus.freepascal.org/Windows_Programming_Tips#FPC_2.6.x.2FLazarus_warning_.28Missing_support_for_SEH.29 for more details. Minimum requirements: Windows: 98 FreeBSD/Linux: gtk 2.8 or qt4.5, 32 or 64bit Mac OS X: 10.5 for Intel cpus, 10.4 for PowerPC, LCL only 32bit, non LCL apps can be 64bit The svn tag is http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_2_6 For people who are blocked by SF, the Lazarus releases from SourceForge are mirrored at: ftp://freepascal.dfmk.hu/pub/lazarus/releases/ and later at (after some time for synchronization) http://michael-ep3.physik.uni-halle.de/Lazarus/releases/ and http://mirrors.iwi.me/lazarus/ Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] section keyword
Hi, I didn't find it in the reference. How does the section keyword work and where is it allowed? const devcfg3: longWord = 3; section '.devcfg3'; Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] FileAge and timezone
Hi, The docs of FileAge does not mention if timezone is used or not. http://lazarus-ccr.sourceforge.net/docs/rtl/sysutils/fileage.html Is the returned OS time stamp with or without timezone? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FileAge and timezone
On Thu, 30 Oct 2014 14:40:56 +0100 (CET) Michael Van Canneyt wrote: > > > On Thu, 30 Oct 2014, Mattias Gaertner wrote: > > > Hi, > > > > The docs of FileAge does not mention if timezone is used or not. > > > > http://lazarus-ccr.sourceforge.net/docs/rtl/sysutils/fileage.html > > > > Is the returned OS time stamp with or without timezone? > > That depends on the OS. FileAge returns whatever the OS returns. Some OS has several functions/options, so there is a choice. > The following is based on memory alone, needs to be checked in code: > It doesn't do any transformations, so I expect it actually to be UTC. > Only when converting to TDateTime is the timzeone introduced. Under Linux I see UTC. But on Windows it seems to return with timezone. See this bug: http://bugs.freepascal.org/view.php?id=26963 Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Mixing PIC non-PIC code/variables when linking a shared library
On Mon, 17 Nov 2014 16:13:40 +0100 Jonas Maebe wrote: > > Dmitry Boyarintsev wrote on ma, 17 nov 2014: > > > So based on the bug report description: "There is no problem with other LCL > > components" > > I guess LCL itself was compiled with PIC flag as well (though, not > > mentioned in the report). > > Yes, fpcmake automatically adds -Cg/-fPIC for x86-64 platforms, > exactly because of this issue. Does "automatically" means here "always on x86_64"? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Mixing PIC non-PIC code/variables when linking a shared library
On Tue, 18 Nov 2014 11:03:03 +0100 Jonas Maebe wrote: >[...] > Yes, but "x86-64" is apparently bit too broad: > * it's added for x86-64/(freebsd, openbsd, netbsd, linux, solaris) > * for Darwin, -Cg is always on by default on all platforms, but this > is done in the compiler itself (because it's also on by default in the > system compilers) Thanks. I will add it to Lazarus. Why does the compiler not always add -Cg on Linux/x86-64? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Default value resourcestring
Hi, How can I get the defaultvalue of a single resourcestring? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] red( clGrayText)
On Mon, 01 Dec 2014 15:17:04 -0200 Philippe wrote: > > > using -Cr (Range Check) option, red( clGrayText) as example, throw > an exception! > > how should I program "red" (or green, blue and may be > some others) functions to avoid that? > > should I write red( clGrayText > and $ff) ? ... another better way? Have you read this? http://wiki.lazarus.freepascal.org/Colors#System_colors Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] red( clGrayText)
On Mon, 01 Dec 2014 22:01:15 -0200 Philippe wrote: >[...] > http://wiki.lazarus.freepascal.org/Colors#System_colors [1] > > > > I have seen it ... but did not catch that it may not work > with red( x) ... making it more simple, it means that the range of > values used for those constants as clGrayText is not TColor compatible. > Is that correct? clGrayText is a TColor, but TColor is not always a simple RGB value. System colors are context sensitive. You might try Red(ColorToRGB(clGrayText)); Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] AnsiStrLComp AnsiStrLIComp
Hi, According to the docs AnsiStrLComp treats #0 as normal characters, which sounds as if it does not stop at #0. Does it stop at #0 or does it not? http://www.freepascal.org/docs-html/rtl/sysutils/ansistrlcomp.html The doc of AnsiStrLIComp says "compares the first MaxLen characters", which sounds as if it does not stop at #0. OTOH the examples seems to stop at #0. Does it stop at #0 or does it not? http://www.freepascal.org/docs-html/rtl/sysutils/ansistrlicomp.html The docs of AnsiStrComp and AnsiStrIComp clearly state they stop at #0. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] AnsiStrLComp AnsiStrLIComp
On Mon, 8 Dec 2014 13:22:42 +0100 Jonas Maebe wrote: > > On 04 Dec 2014, at 16:24, Mattias Gaertner wrote: > > > According to the docs AnsiStrLComp treats #0 as normal characters, > > which sounds as if it does not stop at #0. > > Does it stop at #0 or does it not? > > http://www.freepascal.org/docs-html/rtl/sysutils/ansistrlcomp.html > > > > The doc of AnsiStrLIComp says "compares the first MaxLen characters", > > which sounds as if it does not stop at #0. > > OTOH the examples seems to stop at #0. > > Does it stop at #0 or does it not? > > http://www.freepascal.org/docs-html/rtl/sysutils/ansistrlicomp.html > > Neither of these routines stops at #0. Thanks. Michael, can you add a comment to this example, that runs beyond the strings: Testit('One string','One smaller string',255); Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] AnsiStrLComp AnsiStrLIComp
On Mon, 8 Dec 2014 17:36:43 +0100 (CET) Michael Van Canneyt wrote: >[...] > > Michael, can you add a comment to this example, that runs beyond the > > strings: > > Testit('One string','One smaller string',255); > > ? There is no #0 character. So what does this example prove ? I'm not sure if every reader knows why this example works. The number should be lower or equal the length of the shortest string to avoid running out of bounds. The 255 looks as if it is ok to pass a number bigger than the length of the strings. For example this creates an AV on x86_64: AnsiStrLIComp('A','B',100); Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Error while linking
On Fri, 02 Jan 2015 15:39:39 +0100 Jonas Maebe wrote: > On 02/01/15 15:31, Krzysztof wrote: > > One of my project just started fail on compilation. Other projects > > compile fine. In lazarus message window I get only "Error: Error while > > linking". Normally in that case, more details were printed like "missing > > -lib" etc but here I get only "error while linking". Tried cleanup > > output dir but not helped. How to investigate this? Project dir has > > permissions to write. > > Compile with -Cn, and then to manually run ppas.sh (Linux/Unix) or > ppas.bat (other platforms) from the command line. Sometimes the linker > messages get swallowed by the compiler (or Lazarus?) for some reason. To see all messages in Lazarus use the popup menu of the Messages window (right click). Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Error while linking
On Fri, 2 Jan 2015 16:13:26 +0100 Krzysztof wrote: > 2015-01-02 15:51 GMT+01:00 Mattias Gaertner : > > > > > To see all messages in Lazarus use the popup menu of the > > Messages window (right click). > > > > Thank you Mattias! lgmime-2.6 was hidden in lazarus message window. Problem > solved That message should be visible in Lazarus 1.3. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] character escaping with ^LETTER
On Mon, 19 Jan 2015 08:17:52 -0500 Dmitry Boyarintsev wrote: >[...] > a:=^M; // char(13) >[...] > CodeTools syntax highlighter won't recognize the syntax as characters > either (delphi 7 highlighter doesn't recognize it as a character escaping > as well) FYI: Codetools do not have a syntax highlighter. In Lazarus the highligher of synedit (TSynPasSyn) is used. Codetools should parse it correctly. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Some features for FPC 3.0?
On Tue, 17 Feb 2015 14:25:11 -0300 silvioprog wrote: >[...] > It would be nice if FPC adopt RC versions. So anyone could do tests just > installing it via setup, instead of using GIT / SVN. And Lazarus RCs could > be release using this RCs FPCs (e.g: Lazarus-1.4-RC1 has FPC-3.0.0-RC1). > > - RCs - every three or six months; > - stable - a year. Are you confusing Minor versions with Release Candidates? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Record helpers on built in types?
On Tue, 17 Feb 2015 22:56:18 -0500 Anthony Walter wrote: > Dmitry: > > See this function and test if against a large block of text doing a case > insensitive replace on a moderate length phrase. Match it in speed against > whatever is in the RTL and see if my function is faster and by how much. For speed reasons your functions should call the RTL functions for short strings. They are optimized for that. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] fpc-arm-embedded bin doesn't run
On Wed, 18 Feb 2015 16:02:53 -0700 (MST) turro75 wrote: > ok, > > as I told in the previous post, I 'm now able to run and debug code with the > trunk fpc (3.1.1). > I just made some minor changes in t_embed.pas in order to automatically > create also the bin and call size. > Debugging works "fine" (not yet tested a complex program) with gdb --tui. > Working in lazarus is fine just be sure to use -g only. > Debugging using lazarus seems not possible until some changes in the IDE > happen. Have you tried debug type info dwarf? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Differences between ppc386 and ppcross386
Hi, What are the differences between ppc386 and ppcross386? Related question: When calling "fpc -Pi386" it searches for ppc386, but not for ppcross386. Why is that? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TThread.Queue vs TThread.Synchronize
On Mon, 23 Feb 2015 10:08:45 + Graeme Geldenhuys wrote: > Hi, > > I've recently seen some posts in Delphi groups that the preferred way is > to use TThread.Queue instead of TThread.Synchronize. > > Why is that? What are the benefits? Synchronize waits for the main thread. Queue does not. Both are executed by the main thread via CheckSynchronize. Both are useful. > I've look at FPC trunk and see we now have a Queue() implementation, and > I adjusted a simple multi-threaded GUI example app I had. But I still > don't really understand what is the benefit of Queue vs Synchronise. I > still had to create a "synchronise method" which I pass in to Queue() - > similar to what I did for Synchronize(). > > Also how is Queue() calls processed? For example to get Synchronize() to > work I had to call CheckSynchronize in my main event loop. Is this also > required for Queue() functionality? Yes. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Differences between ppc386 and ppcross386
On Mon, 23 Feb 2015 12:02:52 +0100 Jonas Maebe wrote: > > On 23 Feb 2015, at 11:40, Mattias Gaertner wrote: > > > What are the differences between ppc386 and ppcross386? > > ppcross386 gets compiled as part of a cross build (e.g. when > performing "make all OS_TARGET=win32" on a Linux/i386 machine), but > other than that it is the same as ppc386. The reason is that a cross > build always compiles both a cross-compiler (a Linux/i386-native > ppcross386 in the above scenario) and a native compiler for the target > (a Win32/i386-native ppc386 in the above scenario), and obviously both > binaries can't have the same name since they're both located in the > compiler directory after buidling. I see. Thanks. >[...] Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TThread.Queue vs TThread.Synchronize
On Tue, 24 Feb 2015 09:30:37 + Graeme Geldenhuys wrote: > On 2015-02-23 19:49, Philippe Lévi wrote: > > if code in thread access a local variable (in stack) of the function > > where thread is issued ... it may access "something" which does not > > exist any more. correct? > > Good question, and what I was trying to get at with my second question > on TThread.Queue usage. As Sven mentioned in his reply (and how I > understood it, but needed confirmation), anonymous methods will solve > that issue - once FPC supports anonymous method usage with TThread.Queue(). I think what you mean is "closure". The functions don't need to be "anonymous" for that. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TThread.Queue vs TThread.Synchronize
On Tue, 24 Feb 2015 11:23:41 +0100 Michael Schnell wrote: > On 02/24/2015 11:12 AM, Sven Barth wrote: > > > > > > AFAIK Delphi doesn't use the term "closures" though conceptually > > anonymous functions (as implemented by Delphi) are one way to achieve > > them. > > > What is the advantage of using a "closure" and/or an "anonymous > function" instead of just doing "free;" as the last instruction of a > normal procedure of some object ? The advantage of anonymous is less typing, disadvantage is easy misuse, for example adding redundancy and harder to debug. About closures see for example: https://en.wikipedia.org/wiki/Closure_%28computer_programming%29 Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] fpc-src_2.6.4-140420_i386 from debs at sourceforge : error while processing dpkg install
On Thu, 26 Feb 2015 10:09:33 + Lukasz Sokol wrote: > I got : > " > dpkg: error processing fpc-src_2.6.4-140420_i386.deb (--install): > trying to overwrite > '/usr/share/fpcsrc/2.6.4/packages/postgres/src/postgres3.pp', which is also > in package fpc-source-2.6.4 2.6.4+dfsg-4~bpo70+1 > " > > while installing the three debs intentionally as replacement of those got > from the repo; > > but it seems to have gone through and Lazarus 1.2.6 has started OK. > > Hope this is OK ? You can install either fpc-src or fpc-source, but not both. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] fpc-src_2.6.4-140420_i386 from debs at sourceforge : error while processing dpkg install
On Thu, 26 Feb 2015 12:12:01 + Lukasz Sokol wrote: > On 26/02/15 11:12, Mattias Gaertner wrote: > > On Thu, 26 Feb 2015 10:09:33 + > > Lukasz Sokol wrote: > > > >> I got : > >> " > >> dpkg: error processing fpc-src_2.6.4-140420_i386.deb (--install): > >> trying to overwrite > >> '/usr/share/fpcsrc/2.6.4/packages/postgres/src/postgres3.pp', which is > >> also in package fpc-source-2.6.4 2.6.4+dfsg-4~bpo70+1 > >> " > >> > >> while installing the three debs intentionally as replacement of those got > >> from the repo; > >> > >> but it seems to have gone through and Lazarus 1.2.6 has started OK. > >> > >> Hope this is OK ? > > > > You can install either fpc-src or fpc-source, but not both. > > Ah so I should have uninstalled the 'source' package first... Yes. I will add a 'Replaces: fpc-source', so that the next fpc-src deb will automatically uninstall the fpc-source package. > but will it be a problem if I just leave it as is (with Lazarus1.26 seemingly > having installed itself > parallel to the one from repo (0.9.something), and the sourceforge fpc > package also installed without hitches? It depends on what you do with the sources. Probably it will work for you. I'm not sure what happens when you now uninstall one of them. The cleanest solution is: uninstall both and install only one of them. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] the unexplained 666
Hi, Today I stumbled (again) over TFileStream and it contains the constant 438: constructor TFileStream.Create(const AFileName: string; Mode: Word); begin Create(AFileName,Mode,438); end; You need several searches to find out what the 438 actually is. For example its fpdoc page does not explains it: http://lazarus-ccr.sourceforge.net/docs/rtl/classes/tfilestream.create.html Same for the called FileCreate: http://lazarus-ccr.sourceforge.net/docs/rtl/sysutils/filecreate.html Under Windows the Rights are not used. Under Unix it calls fpOpen, which only tells about "permissions": http://lazarus-ccr.sourceforge.net/docs/rtl/baseunix/fpopen.html Then it calls 'FPC_SYSC_OPEN', which under Linux calls syscall 'open', which after a search reveals, that the mode is a bit field using the S_I* constants, which are usually written in binary, octal or hexadecimal. The octal value of 438 is &666, which is read/write permissions for other/group/owner. Why not write &666? Maybe some religious reasons? ;) Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] the unexplained 666
On Sun, 1 Mar 2015 16:11:06 +0100 (CET) mar...@stack.nl (Marco van de Voort) wrote: > In our previous episode, Mattias Gaertner said: > > Why not write &666? Maybe some religious reasons? ;) > > No, simply that octal literal support is newer than the *nix rtl. ok, although then again: When came binary and hexadecimal? > If you want to work on this, please fix the constants in the FreeBSD console > unit too, there are another couple of hundred such cases there :-) My main concern was the lack of comments/documentation. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Use sleep in thread
On Sat, 28 Feb 2015 19:20:49 + Mark Morgan Lloyd wrote: >[...] > Looking at > http://wiki.lazarus.freepascal.org/Multithreaded_Application_Tutorial#Initialization_and_Finalization > > there are dire warnings that TThread.Create() shouldn't be overridden. That is nonsense. Unless you plan to create arbitrary threads. That paragraph needs to be fixed. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Use sleep in thread
On Mon, 02 Mar 2015 09:05:42 + Mark Morgan Lloyd wrote: > Mattias Gaertner wrote: > > On Sat, 28 Feb 2015 19:20:49 + > > Mark Morgan Lloyd wrote: > > > >> [...] > >> Looking at > >> http://wiki.lazarus.freepascal.org/Multithreaded_Application_Tutorial#Initialization_and_Finalization > >> > >> there are dire warnings that TThread.Create() shouldn't be overridden. > > > > That is nonsense. Unless you plan to create arbitrary threads. > > > > That paragraph needs to be fixed. > > It appears to have been a change put in by "Socke" on the 12th January > this year. Does anybody know why he did it? Probably some misunderstanding of OOP. I changed it. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Warning "Local variable seems to be not initialized" on dyn array
On Tue, 10 Mar 2015 08:48:49 + Lukasz Sokol wrote: > On 10/03/15 06:10, Jürgen Hestermann wrote: >[...] > > Why not simply omit these messages (for managed types)? > > Just because YOU don't need it, doesn't mean it's useless for everybody... > > http://www.freepascal.org/docs-html/prog/progsu80.html#x87-860001.2.80 > > why not just use this to suppress the warning JUST where you DO know it's not > needed? > > (you can suppress warning by number too IIUC). Yes. For example in Lazarus 1.3+ you can right click the message and click on "Hide with project option (-vm5089)". Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] JVM
Hi, I tried to build ppcjvm and failed. I followed the wiki instructions: http://wiki.freepascal.org/FPC_JVM/Building fpcmake of 3.1.1 is in PATH. make CROSSOPT="-O2 -g" CPU_TARGET=jvm OS_TARGET=java clean all It stops Error: Assembler jasmin.jar not found, switching to external assembling I tried the instruction for Jasmin: I downloaded and unpacked jasmin 2.4. Applying the patch failed, because it changes line endings. "patch" needs the option "--binary" for that. It still fails on two files: src/jasmin/parser.java src/jasmin/sym.java Calling build.sh results in build.sh: line 2: $'\r': command not found build.sh: line 16: $'\r': command not found Due to the changed line endings. What is now the right way to get a ppcjvm? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Warning "Local variable seems to be not initialized" on dyn array
On Tue, 10 Mar 2015 12:04:37 + Lukasz Sokol wrote: >[...] > > For example in Lazarus 1.3+ you can right click the message and > > click on "Hide with project option (-vm5089)". > > Cool, but probably not what I meant ;) as this hides it project-wide ? Yes. I guess that is what Jürgen wants. I agree with you that in general the hint is good and should be handled depending on each occurrence. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Warning "Local variable seems to be not initialized" on dyn array
On Tue, 10 Mar 2015 18:08:14 +0100 Jürgen Hestermann wrote: > Am 2015-03-10 um 17:40 schrieb Sven Barth: > > > It mutes the warning with the ID 5089 (the ID can be seen with -vq). So > as long as the managed and unmanaged ones use the same warning ID (AFAIR they > do) they will both be silenced. > > Ups, no, they are different. So at least if you use a current 2.7.1 or > newer only the managed ones will be hidden. > > Currently I use Lazarus 1.4RC1 with FPC Version 2.6.4. > Does this version already have different IDs for managed and non-managed > types? 2.6.4 does not have message 5089. It came with 2.7.1. Luckily 3.0 is not that far away. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PtrInt - possible candidate to be marked as deprecated
On Wed, 18 Mar 2015 14:53:50 + Graeme Geldenhuys wrote: > Based on what the documentation says "introduction of ptrint type was a > mistake", shouldn't the PtrInt type be marked as deprecated in FPC 3.0.0 > and removed in a later release like 3.0.2 or 3.2.0? > > http://www.freepascal.org/docs-html/rtl/system/ptrint.html PtrInt is sometimes used in this case: TList stores arbitrary Pointers. To store an arbitrary integer you cast it with PtrInt. Is there an integer list? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] PtrInt - possible candidate to be marked as deprecated
On Wed, 18 Mar 2015 15:29:14 + Graeme Geldenhuys wrote: > On 2015-03-18 15:23, Tony Whyman wrote: > > PtrInt is used in that very useful method TApplication.QueueAsync > > Call. > > Though I never used the QueueAsync() call myself, but looking at the > declaration, shouldn't that data type be PtrUInt anyway? As far as I > understand Data points to data in memory, which will always be an > positive (unsigned) value, not so? It is arbitrary Data. The passed method already contains an Object (data in memory). The Data is usually used as a state or index within the object. But it can also contain a pointer. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Mode Delphi and functions as parameters.
On Mon, 23 Mar 2015 10:13:54 + "vfclists ." wrote: >[...] > More questions on Mode Delphi. > > 1. Does Mode Delphi simply allow Delphi syntax to be compiled, or does it > also affect the code generation, like data structures, pointer handling, > parameter handling / calling conventions, stack frames etc? Compared to mode objfpc: no. Other modes might have other aligns and calling conventions. But you can change that with compiler directives, so basically a mode is just a nice set of start switches. > 2. When Mode Delphi is applied to a project, ie the .dpr, does it affect > the whole project, or does each project require its own mode delphi > statement? The command line parameters are applied to the whole project, the compiler directives only to the unit. > 3. Can it be switched on and off within the same unit, ie some procedures > and data structures use it, some don't? See compiler directives. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Release of Lazarus 1.4
The Lazarus team is glad to announce the release of Lazarus 1.4. This release was built with FPC 2.6.4, same as the previous release Lazarus 1.2.6. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazarus_1.4.0_release_notes http://wiki.lazarus.freepascal.org/User_Changes_2.6.4 The release is available for download on SourceForge: http://sourceforge.net/projects/lazarus/files/ Choose your CPU, OS, distro and then the "Lazarus 1.4" directory. Windows x64 users: please use the 32 bit installer if possible. See http://wiki.lazarus.freepascal.org/Windows_Programming_Tips#FPC_2.6.x.2FLazarus_warning_.28Missing_support_for_SEH.29 for more details. Minimum requirements: Windows: 98, 2k, XP, Vista, 7, 32 or 64bit. On 64bit it is recommended to use the 32bit IDE. Win98 IDE needs building with flag -dWIN9XPLATFORM. FreeBSD/Linux: gtk 2.8 or qt4.5, 32 or 64bit. Mac OS X: 10.5 to 10.10, 10.9+ debugging requires -gw, LCL only 32bit, non LCL apps can be 64bit. The svn tag is http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_4 For people who are blocked by SF, the Lazarus releases from SourceForge are mirrored at: ftp://freepascal.dfmk.hu/pub/lazarus/releases/ and later at (after some time for synchronization) http://michael-ep3.physik.uni-halle.de/Lazarus/releases/ and http://mirrors.iwi.me/lazarus/ Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Release of Lazarus 1.4
On Wed, 22 Apr 2015 13:41:18 +0200 Rainer Stratmann wrote: > Are there screenshots? > Is it with the new layout, one Window only? No. You can install anchordockdsgn package to get one window. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Lazarus, FreePascal, and translated compiler messages
On Wed, 6 May 2015 10:55:43 +0200 Yann Mérignac wrote: > Hi, > > I am part of a team that is reviewing the French translation of Lazarus. > The French language has accented characters. These characters are not > displayed in the message window of Lazarus. Fixed. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Why does fpc copies *.lfm files to unit output directory
On Tue, 12 May 2015 10:26:04 +0100 Graeme Geldenhuys wrote: > Hi, > > I don't know when this started, but fpc copies *.lfm files to the unit > output directory. Then turns around and complains about duplicate *.lfm > files? Though the complaint about duplicate files might be from Lazarus > IDE - I'm not sure any more with the new Messages Window behaviour in > Lazarus. The duplicate .lfm warnings come from the IDE. The compiler messages are under "Compile ...". > > Messages, Warnings: 34 > Warning: Duplicate file "fpideexteditorinsertfilenameunit.lfm" in > "weblaz 1.0", > path="/home/graemeg/devel/lazarus/components/fpweb/lib/x86_64-linux/fpideexteditorinsertfilenameunit.lfm" > Warning: Duplicate file "fpideexteditorinsertfilenameunit.lfm" in > "lazwebextra 0.9", > path="/home/graemeg/devel/lazarus/components/fpweb/fpideexteditorinsertfilenameunit.lfm" The IDE warns because the lfm file is in the output of weblaz and in the sources of lazwebextra as well. And lazwebextra uses weblaz. This typically happens when a file was moved and the old copy was not deleted. In this case it is by design: Package lazwebextra is now an empty dummy package. See the description of the package. The two packages share the lfm files. I added a check, so that the IDE does not warn for files in shared source directories. > I first thought it was Lazarus IDE copying the files, but then found out > that it is fpc. Why exactly is fpc copying the file? If it is to find > the *.lfm files while linking... AFAIK this is the reason. >[...] > It's not just duplicate files, it seems sometimes the *.lfm files can > changes, without the associated *.pas file changing. In such cases fpc > doesn't seem to copy the *.lfm files, but then compilation/linking > fails. I had to create a bash script to manually clear out all unit > output directories to resolve this issue. This happens a couple of times > per week now. I find this annoying too. From an user pov it looks like a compiler bug. Maybe some compiler guru can tell if this is a bug or by design. Then I know if Lazarus needs a workaround. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Release of Lazarus 1.4.2
The Lazarus team is glad to announce the release of Lazarus 1.4.2. This release was built with FPC 2.6.4, same as the previous release Lazarus 1.4.0. Here is the list of fixes for Lazarus 1.4.2: http://wiki.freepascal.org/Lazarus_1.4_fixes_branch#Fixes_for_1.4.2_.28Merged.29 Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazarus_1.4.0_release_notes http://wiki.lazarus.freepascal.org/User_Changes_2.6.4 The release is available for download on SourceForge: http://sourceforge.net/projects/lazarus/files/ Choose your CPU, OS, distro and then the "Lazarus 1.4.2" directory. Windows x64 users: please use the 32 bit installer if possible. See http://wiki.lazarus.freepascal.org/Windows_Programming_Tips#FPC_2.6.x.2FLazarus_warning_.28Missing_support_for_SEH.29 for more details. Minimum requirements: Windows: 98, 2k, XP, Vista, 7, 32 or 64bit. On 64bit it is recommended to use the 32bit IDE. Win98 IDE needs building with flag -dWIN9XPLATFORM. FreeBSD/Linux: gtk 2.8 or qt4.5, 32 or 64bit. Mac OS X: 10.5 to 10.10, 10.9+ debugging requires -gw, LCL only 32bit, non LCL apps can be 64bit. The svn tag is http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_4_2 For people who are blocked by SF, the Lazarus releases from SourceForge are mirrored at: ftp://freepascal.dfmk.hu/pub/lazarus/releases/ and later at (after some time for synchronization) http://michael-ep3.physik.uni-halle.de/Lazarus/releases/ and http://mirrors.iwi.me/lazarus/ Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Installing fpc
On Tue, 8 Sep 2015 11:21:18 +0200 "Tomas Hajny" wrote: >[...] > > I do think that Steph means the FPC tar as Lazarus does AFAIK not have a > > tar-installer like FPC does... True. It provides a source tar (and a zip) though. > Alright, could be. However, if this is the case, I'm afraid that the > resolution of the file owner in the tar installer may not solve the issue > with requirements of the debian package for Lazarus mentioned at the > beginning, because dpkg would probably not consider the dependency of the > Lazarus .deb package on FPC 2.6.4 or higher as fulfilled if FPC was > installed using the .tar installer rather than the appropriate .deb > package. I may be completely wrong, of course, but that's what I would > assume based on my (limited ;-) ) knowledge of dependency handling for > dpkg, etc. Correct. You can force it, but I would not recommend that. If you can install Lazarus via dpkg then I recommend to install fpc via dpkg too. If you can't install FPC via dpkg, see below for compiling Lazarus on a debian system: http://wiki.lazarus.freepascal.org/Installing_Lazarus#Downloading_Lazarus_Source_Code Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Resourcestrings in FPC 3.0
On Thu, 24 Sep 2015 09:10:06 +0200 Martin Schreiber wrote: >[...] > Another question, it looks to me that -Fcutf8 does not work like {$codepage > utf8} for string constants. What do you mean? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] How to compile Lazarus program using only FPC?
On Thu, 24 Sep 2015 16:21:31 +0100 Graeme Geldenhuys wrote: > On 2015-09-24 16:14, Michael Van Canneyt wrote: > > Since the projects in question are lazarus projects to begin with, this is > > a non-issue. > > Yes for LCL based apps. If I had to be technical... Lazarus IDE can > "manage" other non-LCL apps too, and those can include packages etc etc. > So you still have a project file and such. The original message in this > thread never said it was a LCL application. ;-) So Waldo's concern is > still a valid point. > > Is lazbuild a pure console application? Yes. > If so, no problem, but my guess > is that it still uses the LCL somewhere (ie: NoGUI widget type). Yes, it (still) needs some LCL units, but no gui libs. > I've never used lazbuild personally, so I don't actually know. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] *SPAM* Re: How to compile Lazarus program using only FPC?
On Fri, 25 Sep 2015 11:16:55 +0200 Michael Schnell wrote: > On 09/25/2015 11:09 AM, Sven Barth wrote: > > > > > "Lazarus" is the name for two completely different things > > > > ... please don't introduce confusion where there is none. > > > I suppose this confusion already is ubiquitous (and miner as the > "_first_name_" of the LCL *is* "Lazarus (Component Library)" ). > > Of course to be absolutely correct I should have written: > > When installing "Lazarus" you usually install two completely different > things at the same time: > 1) the IDE >2) the LCL library. I also ask you kindly to stop spreading FUD. Lazarus is the IDE and the project containing a whole bunch of packages. Many of them use Lazarus in their names. LCL is the most prominent. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FileIO in FPC 3.0
On Fri, 25 Sep 2015 13:47:22 +0200 (CEST) mar...@stack.nl (Marco van de Voort) wrote: >[...] > BSD/Linux afaik has the same problem. The filesystem is binary, not textual. > The textual aspect is only interpretation. Yes. I see invalid UTF-8 file names on Linux systems often (cannot be converted to UTF-16). Are invalid UTF-16 file names under Windows really a practical problem? What program allows to create invalid UTF-16 file names? With "invalid UTF-16" I mean not-convertable-to-UTF-8. I don't mean invalid code points. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Methods for autoupdating fpc programs?
On Sun, 4 Oct 2015 12:37:29 +0100 Graeme Geldenhuys wrote: > On 2015-10-03 19:30, Bo Berglund wrote: > > But how could one exchange a running program on the pi from within > > itself? > > On non-Windows platforms it is much easier, because you can normally > replace a program on file, while it is running in memory. Windows > doesn't allow that. Either way the solution is quite simple for most > platforms. That is not entirely true. Replacing a running program by simply copying can result under Linux in 'text file busy'. You can rename a running executable, allowing to copy a new version. This works on Windows and Linux. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Methods for autoupdating fpc programs?
On Sun, 4 Oct 2015 19:17:14 +0100 Graeme Geldenhuys wrote: > On 2015-10-04 19:14, Graeme Geldenhuys wrote: > > I can't remember what it is called, but I can find the name if > > I search for it > > I think it was called "SELinux" - Security-Enhanced Linux. If it would be a security barrier, it would never work - not sometimes. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Methods for autoupdating fpc programs?
On Sun, 4 Oct 2015 21:06:57 +0200 Mattias Gaertner wrote: > On Sun, 4 Oct 2015 19:17:14 +0100 > Graeme Geldenhuys wrote: > > > On 2015-10-04 19:14, Graeme Geldenhuys wrote: > > > I can't remember what it is called, but I can find the name if > > > I search for it > > > > I think it was called "SELinux" - Security-Enhanced Linux. > > If it would be a security barrier, it would never work - not sometimes. After some research it turns out it is something trivial. "cp -i" checks if the file is in use and if yes it does not overwrite it, even though you answered "yes". You can overwrite the file with "cp -f". Or you can remove the file and then copy. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Lazarus Release 1.4.4
The Lazarus team is glad to announce the release of Lazarus 1.4.4. This release was built with FPC 2.6.4, same as the previous release Lazarus 1.4.2. Here is the list of fixes for Lazarus 1.4.4: http://wiki.freepascal.org/Lazarus_1.4_fixes_branch#Merged_revisions_for_1.4.4 Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazarus_1.4.0_release_notes http://wiki.lazarus.freepascal.org/User_Changes_2.6.4 Important note for Mac OS X: OS X 10.10 Yosemite no longer supports the default debugging format of FPC 2.6.4 (-g stabs). Lazarus now uses -gw (dwarf) instead on darwin. The release is available for download on SourceForge: http://sourceforge.net/projects/lazarus/files/ Choose your CPU, OS, distro and then the "Lazarus 1.4.4" directory. Windows x64 users: please use the 32 bit installer if possible. See http://wiki.lazarus.freepascal.org/Windows_Programming_Tips#FPC_2.6.x.2FLazarus_warning_.28Missing_support_for_SEH.29 for more details. Minimum requirements: Windows: 98, 2k, XP, Vista, 7, 8, 32 or 64bit. On 64bit it is recommended to use the 32bit IDE. Win98 and WinNT IDE needs building with flag -dWIN9XPLATFORM. FreeBSD/Linux: gtk 2.8 or qt4.5, 32 or 64bit. Mac OS X: 10.5 to 10.10, 10.9+ debugging requires -gw, LCL only 32bit, non LCL apps can be 64bit. The svn tag is http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_4_4 For people who are blocked by SF, the Lazarus releases from SourceForge are mirrored at: ftp://freepascal.dfmk.hu/pub/lazarus/releases/ and later at (after some time for synchronization) http://michael-ep3.physik.uni-halle.de/Lazarus/releases/ and http://mirrors.iwi.me/lazarus/ Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Lazarus Release 1.4.4
On Tue, 6 Oct 2015 19:23:26 +0200 Jonas Maebe wrote: > On 06/10/15 19:13, Mattias Gaertner wrote: > > Important note for Mac OS X: OS X 10.10 Yosemite no longer supports the > > default debugging format of FPC 2.6.4 (-g stabs). Lazarus now uses -gw > > (dwarf) instead on darwin. > > That's not really correct: it's Xcode 7 that doesn't support this > anymore. Xcode 7 is available for OS X 10.10 and OS X 10.11 (but on OS X > 10.10 you can also use Xcode 6.4, which does still support stabs). I see. The software update suggested it and I simply clicked the default, so I assumed that it is bundled. > In any case, it will prevent a lot of future questions on the lazarus > forum, thanks :) Hopefully it will not run out of questions. ;) Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Loading PNG files as OpenGL textures
On Thu, 15 Oct 2015 15:30:41 +0700 Ryan Joseph wrote: > > > On Oct 14, 2015, at 1:49 PM, Michael Van Canneyt > > wrote: > > > > Type > > TMyImage = Class(TFPCompactImgRGBA8Bit) > > Public > > property Data : PFPCompactImgRGBA8BitValue read FData; > > end; > > > > > > Should do it. Or if you don't need Alpha: > > > > TMyImage = Class(TFPCompactImgRGB8Bit) > > Public > > property Data : PFPCompactImgRGB8BitValue read FData; > > end; > > > > You could throw in a property to get a direct pointer > > TFPCompactImgRGBA8Bit descends from TFPMemoryImage I assume? Actually it works like TFPMemoryImage and descends from TFPCustomImage. The only difference is that it uses 4*8=32bit per pixel instead of 4*16bit. It is only a few lines of code, so if you need a different pixel format or scan lines it is really easy to create your own image class. > I need to draw text as textures also and I found an example at > http://wiki.freepascal.org/fcl-image#Drawing_text which uses > TFPMemoryImage. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Delphi-FPC difference in handling TList
On Tue, 20 Oct 2015 08:31:57 +0200 Bo Berglund wrote: > I am porting a Delphi class to FPC and I ran into a problem concerning > TList: > > FCommands.Sort(CommandCompare); > > This generates an error: > Error: Wrong number of parameters specified for call to > "CommandCompare" > > This call works just fine in Delphi and I have no clue as to why it > happens in FPC. http://wiki.freepascal.org/FPC_message:_Wrong_number_of_parameters_specified Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Basic Windows tutorial
On Sat, 24 Oct 2015 09:36:25 +0700 Ryan Joseph wrote: >[...] > I started a project using the “simple application” template which made a > console window I don’t really want. Is there a way to remove that window? I > don’t see any code which is creating it. > > Can I route STDOUT (does that exist on Windows?) from writeln to the message > window in Lazarus? That’s pretty typical for development and I can’t see > where it’s going right now. The console window is the STDOUT on Windows. Without it you can't use writeln. http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Console_output_for_GUI_application There are various logging systems. For example: http://wiki.lazarus.freepascal.org/LazLogger > Do I need to do anything in Lazarus to package application resources (like > images, data files) or do I just include them in the same directory as the > executable? That’s just a general Windows question I guess but Lazarus seems > to have a guy for this. FPC has a cross platform solution for resources: http://wiki.lazarus.freepascal.org/Lazarus_Resources#FPC_resources And Lazarus has a GUI for that: Project / Project Options / Resources Matias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] fppkg compiler upgrade
Hi, I have fpc 2.6.4 on Linux and "fppkg list" shows the 2.6.4 packages. Then I install fpc 3.1.1 using "make install". fppkg still shows the 2.6.4 packages. What is the proper way of upgrading fppkg? The wiki page does not tell me: http://wiki.lazarus.freepascal.org/fppkg Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] fppkg compiler upgrade
On Sun, 22 Nov 2015 20:55:14 -0700 (MST) leledumbo wrote: > > What is the proper way of upgrading fppkg? > > $ rm ~/.fppkg/config/default > > now rerun fppkg, it should create a new config. if it still shows 2.6.4, > that means your 3.1.1 is inaccessible or has lower precedence than your > 2.6.4. Thanks. Should I add this to the wiki? Is this also needed when installing FPC with the other installers like deb, rpm, install.sh? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC 3.x for Windows and code page conversion
On Mon, 23 Nov 2015 16:43:18 +0100 Lubos Pintes wrote: > Hello, > I am developing a console application which receives an UTF-8 encoded > text through stdin. > The text is, after possible modification, sent to SAPI5. The SAPI5 > generated interface wrappers have parameters of type string. > In FPC 2.6.4, I used UTF8toANSI on various places and that worked well. > Now after reading about FPC 3.x's unicode support, I thought that adding > this line say after begin in the main program could be enough: > SetMultiByteConversionCodePage(CP_UTF8); The above setting makes UTF8ToAnsi to convert the string to UTF-16 and back to UTF-8. > It however doesn't work. > How can I solve this without conversion to ANSI? Do you want to convert an UTF8 string to the system codepage? Are you using any Lazarus units? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Implementing Factory Method with Pascal
One solution: var animal: TDog; BEGIN animal := TAnimalFactory.create(atDog) as TDog; try animal.bark; finally animal.free; end; END. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC Pestering Peacock (3.0.0) release
On Wed, 25 Nov 2015 22:52:04 +0100 Joost van der Sluis wrote: >[...] > Downloads are available at our website: > http://www.freepascal.org/download.var I can't find the Linux rpm/deb packages on Sourceforge. The other sites have them. Is this by design? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC Pestering Peacock (3.0.0) release
On Wed, 02 Dec 2015 15:37:18 +0100 Jonas Maebe wrote: > > Mattias Gaertner wrote on Wed, 02 Dec 2015: > > > I can't find the Linux rpm/deb packages on Sourceforge. The other sites > > have them. > > Is this by design? > > The rpms are at > http://sourceforge.net/projects/freepascal/files/Linux/3.0.0/RPM/ You are right. Sorry for the false alarm. > There are no debs for 3.0.0 on either the regular sites or on > Sourceforge, afaik. The reason is that the debs contain all kind of > distribution-specific patches, which are maintained by the > distributions themelves. The RPMs you can download are the same as > what is/will be in the distributions. Is there a documentation, how to get/install the Debian experimental FPC 3.0? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Win32 download still showing 2.6.4
Hi, When I go to www.freepascal.org, click Downloads, Intel/i386, Win32 Only Sourceforge has 3.0.0. Austria, Hungary and Netherlands still show: The latest release version is 2.6.4. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Unicode file names
Hi, fpcres fails on Windows with paths containing non ASCII characters. The compiler itself happily compiles units. FPC 3.0.0 and 3.1.1. Is that a regression? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Unicode file names
On Sat, 5 Dec 2015 12:55:42 +0100 (CET) Michael Van Canneyt wrote: > > > On Sat, 5 Dec 2015, Mattias Gaertner wrote: > > > Hi, > > > > fpcres fails on Windows with paths containing non ASCII characters. The > > compiler itself happily compiles units. FPC 3.0.0 and 3.1.1. > > > > Is that a regression? > > I don't think so, since that has probably never worked correctly. Is there any FPC tool that supports Unicode file names on Windows? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Unicode file names
On Sat, 5 Dec 2015 13:44:08 +0100 Jonas Maebe wrote: > On 05/12/15 13:36, Mattias Gaertner wrote: > > On Sat, 5 Dec 2015 12:55:42 +0100 (CET) > > Michael Van Canneyt wrote: > > > >> On Sat, 5 Dec 2015, Mattias Gaertner wrote: > >> > >>> fpcres fails on Windows with paths containing non ASCII characters. The > >>> compiler itself happily compiles units. FPC 3.0.0 and 3.1.1. > >>> > >>> Is that a regression? > >> > >> I don't think so, since that has probably never worked correctly. > > > > Is there any FPC tool that supports Unicode file names on Windows? > > The title of the message and your latest questions talks about unicode > "Unicode", but in your original text you talk about "non-ASCII". Did you > mean "non-ANSI"? Sorry for the confusion. The compiler itself seems to support the Windows console codepage (file names and output), which I guess is ANSI, so more than ASCII (#32-#126), but not Unicode. fpcres seems to only support ASCII, which surprises me. Either my tests are wrong or fpcres is more limited than the compiler. > No FPC tools contain any platform-specific file handling, nor do they > change any of the Default.*CodePage settings. They all use either > ansistrings or shortstrings. Thanks, that answers my second question. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] fpdoc project file
Hi, The 3.1.1 fpdoc -h help has some confusing items. Can someone explain them please: --project=fileUse file as project file --write-project=file Do not write documentation, create project file instead --write-project=file Write all command-line options to a project file Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Can fpc 3.0 release be installed using apt-get on Linux Mint?
On Mon, 07 Dec 2015 21:52:35 +0100 Bo Berglund wrote: > On Mon, 7 Dec 2015 20:27:12 +0100 (CET), Michael Van Canneyt > wrote: >[...] > 1) Went to http://www.freepascal.org/down/i386/linux-hungary.var > > 2) Downloaded the "everything" file > ftp://ftp.hu.freepascal.org/pub/fpc/dist/3.0.0/i386-linux/fpc-3.0.0.i386-linux.tar > > 3) Extracted its contents to the Download dir > > 4) Then I entered the directory and issued the command: > sudo sh install.sh > > 5) During installation I was asked to select target and entered > /usr/local as I was told in another case some time ago. > > 6) Then I just replied Y to most of the questions and it installed > apparently just fine. > At least it responds to my fpc -h command... That is the right way. As an alternative you can install the FPC 2.6.4 deb (e.g. from the Lazarus site), then download the FPC 3.0.0 sources and 'make install' them. > Now I have to deal with Lazarus, but that is another list/forum... Lazarus needs libgtk2.0-dev, which should automatically install libgtk2.0-common. Lazarus 1.6RC1 will be available soon and it provides deb packages for FPC 3.0.0 and Lazarus. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Can fpc 3.0 release be installed using apt-get on Linux Mint?
On Mon, 07 Dec 2015 23:15:50 +0100 Bo Berglund wrote: > On Mon, 7 Dec 2015 22:16:26 +0100, Mattias Gaertner > wrote: > > >> Now I have to deal with Lazarus, but that is another list/forum... > > > >Lazarus needs libgtk2.0-dev, which should automatically install > >libgtk2.0-common. > > I looked into my Raspberry Pi2 install notes and found these > dependencies for Lazarus: > > Get additional packages: > > apt-get update > apt-get install -y libx11-dev libgdk-pixbuf2.0-dev libcairo2-dev > gir1.2-coglpango-1.0 libpangox-1.0-dev xorg-dev libgtk2.0-dev > libpango1.0-dev > > Are most of these superfluous? Is it enough with libgtk2.0-dev? I have not tried on Linux-Mint. Can you test? If building Lazarus fails with a linker error you will see what lib is missing. > Will there be a tar package like for fpc No. Building Lazarus is easy (make all). The tricky part is helping the user to install the required libraries. If someone provides a script that checks the common distros and maintains the script I would build such a tar. > or should I go for an svn checkout? I recommend that. This makes upgrading easy. > Is there an RC tag for Lazarus? Many. For example: http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_6_RC1 Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Can fpc 3.0 release be installed using apt-get on Linux Mint?
On Mon, 07 Dec 2015 23:36:17 +0100 Jonas Maebe wrote: > Michael Van Canneyt wrote: > > I believe fpc 3.0 is in debian experimental, but it would be a very bad > > idea to use that in linux mint. > > If you limit yourself to just using FPC from Debian experimental, I > don't think there's much that can go wrong. That's probably true, but you are mixing a Debian repository with Ubuntu/Linux Mint/etc repository, which gives warnings and anyone you are asking for help will tell you that it is a bad idea. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Can fpc 3.0 release be installed using apt-get on Linux Mint?
On Mon, 07 Dec 2015 23:47:36 +0100 Bo Berglund wrote: >[...] > >I have not tried on Linux-Mint. > >Can you test? > > I did as follows: > sudo apt-get install libgtk2.0-dev > > It pulled no less than 73 different packages Debian is great at splitting packages into smaller packages. Does Lazarus link with those packages? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Can fpc 3.0 release be installed using apt-get on Linux Mint?
On Mon, 07 Dec 2015 23:56:56 +0100 Bo Berglund wrote: >[...] > Target OS: Linux for i386 > Compiling lazres.pp > Linking ./lazres > Warning: "crti.o" not found, this will probably cause a linking > failure > Warning: "crtn.o" not found, this will probably cause a linking > failure > /usr/bin/ld: warning: ./link.res contains output sections; did you > forget -T? > /usr/bin/ld: skipping incompatible > /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o when searching for > /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o > /usr/bin/ld: cannot find /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o Are you sure you installed the right compiler? i386 <> x86_64, 32 vs 64bit. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Can fpc 3.0 release be installed using apt-get on Linux Mint?
On Tue, 8 Dec 2015 00:21:28 +0100 Mattias Gaertner wrote: > On Mon, 07 Dec 2015 23:56:56 +0100 > Bo Berglund wrote: > > >[...] > > Target OS: Linux for i386 > > Compiling lazres.pp > > Linking ./lazres > > Warning: "crti.o" not found, this will probably cause a linking > > failure > > Warning: "crtn.o" not found, this will probably cause a linking > > failure > > /usr/bin/ld: warning: ./link.res contains output sections; did you > > forget -T? > > /usr/bin/ld: skipping incompatible > > /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o when searching for > > /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o > > /usr/bin/ld: cannot find /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o > > Are you sure you installed the right compiler? > i386 <> x86_64, 32 vs 64bit. I tried Linux Mint 17.3 64bit. After installing fpc x86_64 tar and libgtk2.0-dev, Lazarus builds fine. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC Unicode / CodePage aware strings
On Thu, 10 Dec 2015 12:17:28 +0100 Jonas Maebe wrote: >[...] > > Try {$codepage utf8}. > > That won't change anything, because {$mode delphiunicode} implies "use > the default system code page to interpret the source code", and that's > UTF-8 on his system. Does that mean a {$mode delphiunicode} resets a -Fc parameter? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC Unicode / CodePage aware strings
On Thu, 10 Dec 2015 12:02:31 + Graeme Geldenhuys wrote: > On 2015-12-10 11:16, Jonas Maebe wrote: > > There is no such thing as "official FPC Unicode". We added support for > > codepage-aware ansistrings. We added unicodestring overloads for a > > Does the type UnicodeString always mean UTF-16 encoded text (like it's > Delphi counterpart)? If so, that unfortunate. Yes. > Can the encoding of UnicodeString be changed to say UTF-8? No. > And yes, I > know there is a UTF8String type too, but I'm specifically referring to > UnicodeString (as in the Unicode standard supporting multiple > encodings), as many RTL functions seem to use that specific type. Many RTL functions support UTF8String, AnsiString too, as Jonas already pointed out. > > The test program you posted later does not work completely because it > > uses routines that have not yet been adapted (UpCase and ToUpper are > > OK, so FPC unicode is still far from usable, as some RTL function will > work, and others won't. :-/ With that conclusion, I'll then keep > fpGUI's Unicode support exactly as it currently is. If you have a working Unicode solution there is no reason to abandon it. The FPC team did a great job keeping compatibility (contrary to Delphi). Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] set code page
On Thu, 17 Dec 2015 13:36:17 +0100 Dariusz Mazur wrote: > Hi >is there possible to set codepage {$codepage xxx} to cp_none Do you mean CP_ACP? > for example one source file have {$codepage 1250} but rest i need > default (without any setting) Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Linker error
Hi, What could be the cause of this linker error: main.pp(6923,23) Warnung: Symbol "CommandLine" ist veraltet /usr/bin/ld.bfd: warning: ../link.res contains output sections; did you forget -T? /usr/bin/ld.bfd: /usr/lib/fpc/3.0.0/units/x86_64-linux/rtl/cprt0.o: unrecognized relocation (0x2a) in section `.text' /usr/bin/ld.bfd: final link failed: Bad value Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] buggy debian package
Hi, Debian has a FPC 3.0.0 package called "rc-buggy". https://packages.debian.org/search?keywords=fpc&searchon=names&suite=all§ion=all Is it just me, or does "buggy" sound a bit below awesome? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Linker error
On Fri, 18 Dec 2015 11:30:00 +0100 Jonas Maebe wrote: > > Mattias Gaertner wrote on Fri, 18 Dec 2015: > > > What could be the cause of this linker error: > > > > main.pp(6923,23) Warnung: Symbol "CommandLine" ist veraltet > > /usr/bin/ld.bfd: warning: ../link.res contains output sections; did > > you forget -T? > > /usr/bin/ld.bfd: /usr/lib/fpc/3.0.0/units/x86_64-linux/rtl/cprt0.o: > > unrecognized relocation (0x2a) in section `.text' > > /usr/bin/ld.bfd: final link failed: Bad value > > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=807170#19 Does that mean the fpc 3.0.0 (rc-buggy) package only works on debian unstable? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Constructor question
On Sat, 9 Jan 2016 21:46:19 +0100 Bart wrote: > Hi, > > Is this legal Pascal? > > uses > classes,sysutils; > > type > { TA } > TA = class > protected > F1: Integer; > F2: Integer; > public > constructor Create; virtual; > end; > { TB } > TB = Class(TA) > constructor Create; override; > end; > > { TB } > constructor TB.Create; > begin > writeln('TB.Create'); > F1 := 1;// am I allowed to access F1 before calling > inherited Create? Yes. > F2 := 2; > inherited Create; > end; > { TA } > constructor TA.Create; > begin > writeln('TA.Create: F1 = ',F1,' F2 = ',F2); > end; > > > var > A,B: TA; > begin > A := nil; > B := nil; > try > try > A := TA.Create; > B := TB.Create; > except > on E: Exception do writeln(E.ClassName,': ',E.Message) > end; > finally > if Assigned(A) then A.Free; > if Assigned(B) then B.Free; > end; > end. > > > Q: am I allowed to access a property/field of TA in the constructor of > TB before calling inherited Create there? Yes. > It compiles and it ouputs: > TA.Create: F1 = 0 F2 = 0 > TB.Create > TA.Create: F1 = 1 F2 = 2 > > This is what I intended, but is it legal, or does it just work by chance? It works by design. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] location modifier
Hi, I can't find the 'location' modifier in the docs. Is it missing? For example: function bsd_socket(Domain: LongInt location 'd0'; Type_: LongInt location 'd1'; Protocol: LongInt location 'd2'): LongInt; syscall SocketBase 30; See for example packages/rtl-extra/src/amiga/sockets.pp Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] location modifier
On Mon, 18 Jan 2016 16:40:17 +0100 (CET) Michael Van Canneyt wrote: > > > On Mon, 18 Jan 2016, Mattias Gaertner wrote: > > > Hi, > > > > I can't find the 'location' modifier in the docs. Is it missing? > > I didn't even know this modifier existed. > Let alone that I know what it does > (although I can take an educated guess) Yes, me too. But to fix http://bugs.freepascal.org/view.php?id=29350 I need scope and order. Is it Amiga only? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] location modifier
On Mon, 18 Jan 2016 16:59:49 +0100 (CET) "Karoly Balogh (Charlie/SGR)" wrote: >[...] > And there's no need to take educated guesses, it's all documented in the > wiki: > > http://wiki.freepascal.org/Amiga#Introduction_to_SysCalls > http://wiki.freepascal.org/MorphOS#Introduction_to_SysCalls > > From syntax PoV, the argument is always a two character string, and can > contain 'd0'-'d7', and 'a0'-'a6', which are the 68k CPU's data and address > registers, respectively. > > Syscalls also exist on AROS/i386 and AROS/x86_64 (for now), but there the > locations are defined by the ABI, without the need to be specified > explicitly. In the future, I plan to reuse syscalls and the location > syntax for a possible Atari port too. > > If there are any more questions, I'm happy to answer. Thanks. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Pascal Lexical Diagrams
On Sat, 30 Jan 2016 04:45:27 -0500 Anthony Walter wrote: > I've been working on writing Javascript to generate lexical language > diagrams for the getlazarus.org learning center portal. > > With my script I'm able to render these diagrams which will be appear under > the Free Pascal language Lexical topic: > > http://cache.getlazarus.org/images/lexical-diagrams.png A finalization section can exist without initialization. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] buggy debian package
On Mon, 01 Feb 2016 13:30:51 +0100 Jonas Maebe wrote: >[...] > FWIW, last weekend FPC 3.0 was promoted from Debian Experimental to > Debian Unstable. Awesome :) Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Please someone explain this to me
> Sven Barth hat am 10. Februar 2016 um 15:09 > geschrieben: > [...] > > The {%...} directive is a comment in other contexts and can be used safely. > > What about include files included by other include files? That is no problem for the MainUnit directive. The directive tells the codetools the default start file of the scattered unit. If the IDE has parsed a unit which uses the include file, the MainUnit directive is ignored. If a file is included by multiple units, you can give a common unit. Basically it is just a convenient fallback. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Please someone explain this to me
> Michael Van Canneyt hat am 11. Februar 2016 um 04:27 > geschrieben: >[...] > Lazarus IDE shows a tooltip when you hover over an identifier with the mouse. > I suspect it will take one on the team less than 10-minutes to add the unit > name to the tooltip, in addition to the package and source file name. Done. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Please someone explain this to me
On Wed, 10 Feb 2016 05:10:55 -0500 Anthony Walter wrote: >[...] > Additionally, and in a different scenario, when the identifier IS defined > and several units are in the uses clause the goto declaration can jump to > an include file without any information pertaining to which of the units is > including the file. To the best of my knowledge there isn't a straight > forward way to figure this out, If Lazarus has found the declaration there are a few features that might help: Search / Goto include directive. This will take you one step up. Code Explorer / Surrounding Source / Unit Information Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Happy tickets benchmark
On Sun, 14 Feb 2016 10:11:54 +0100 Florian Klaempfl wrote: >[...] > For the record: with a few changes in the compiler I could reduce the > execution time of the example significantly . But I won't commit it > probably (maybe parts of it): extensive loop unrolling and loop > invariant search has normally little advantages in real world programs > and increases only compilation times. If it is easy to implement could it be optional? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Happy tickets benchmark
On Sun, 14 Feb 2016 10:35:22 +0100 Florian Klaempfl wrote: >[...] > Do you think people will bother? Nobody mentioned to the original poster > so far: > - that the used FPC is outdated > - that only -O2 is used instead of -O3 (or -O4 with 3.0.0) > - that even FPC 2.6.4 has a -Ooloopunroll option which is never enabled > by default and which is worth a try > > I do not know if the points above really effect the example, but it > tells me enough not to bother either :) Maybe documentation helps here. Is there already a page "pimp my fpc"? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Lazarus Release 1.6
The Lazarus team is glad to announce the release of Lazarus 1.6. This release was built with FPC 3.0.0. The previous release Lazarus 1.4.4 was built with FPC 2.6.4. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazarus_1.6.0_release_notes http://wiki.lazarus.freepascal.org/User_Changes_3.0.0 The release is available for download on SourceForge: http://sourceforge.net/projects/lazarus/files/ Choose your CPU, OS, distro and then the "Lazarus 1.6" directory. Checksums for the SourceForge files: http://www.lazarus-ide.org/index.php?page=checksums#1_6 Minimum requirements: Windows: 98, 2000, XP, Vista, 7, 8/8.1, 10, 32 or 64 bit. Win98 and WinNT IDE needs FPC 2.6.4 and building with flag -dWIN9XPLATFORM. FreeBSD/Linux: gtk 2.8 or qt4.5, 32 or 64bit. Mac OS X: 10.5 to 10.11, LCL only 32bit, non LCL apps can be 64bit. The svn tag is http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_6 Here is the list of fixes for Lazarus 1.6: http://wiki.freepascal.org/Lazarus_1.6_fixes_branch For people who are blocked by SF, the Lazarus releases from SourceForge are mirrored at: ftp://freepascal.dfmk.hu/pub/lazarus/releases/ and later at (after some time for synchronization) http://michael-ep3.physik.uni-halle.de/Lazarus/releases/ and http://mirrors.iwi.me/lazarus/ Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] IsValidIdent() with dots
On Wed, 23 Mar 2016 10:28:15 +0200 Juha Manninen wrote: > Hi > > Is there a function like IsValidIdent but accepting also dots (.), > as in name "TForm1.Action1Execute"? FPC 3.1.1 has function IsValidIdent(const Ident: string; AllowDots: Boolean = False; StrictDots: Boolean = False): Boolean; Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Default source encoding
Hi, According to http://wiki.freepascal.org/index.php?title=FPC_Unicode_support#String_constants "the constant strings are assumed to have code page 28591 (ISO 8859-1 Latin 1; Western European)." Is this true? Or is the compiler using the system codepage? It was added in this revision by Jonas in Jan 6th 2014: http://wiki.freepascal.org/index.php?title=FPC_Unicode_support&oldid=75574 Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal