Re: [fpc-pascal] For..in enumerator for generic records?
> I have a generic record I would like to enumerate using for..in loops. Is this even possible? I tried briefly and it wasn’t clear this was possible so I thought I’d ask first. Thanks. Take a look at how gvector implements it: http://svn.freepascal.org/svn/fpc/tags/release_3_0_0/packages/fcl-stl/src/gvector.pp -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/For-in-enumerator-for-generic-records-tp5726980p5726981.html Sent from the Free Pascal - General mailing list archive at Nabble.com. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] For..in enumerator for generic records?
Am 30.11.2016 05:35 schrieb "Ryan Joseph" : > > I have a generic record I would like to enumerate using for..in loops. Is this even possible? I tried briefly and it wasn’t clear this was possible so I thought I’d ask first. Thanks. > Take a look at packages/fcl-stl/src/gvector.pp, it's a generic vector container that provides an enumerator. Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Using the LCL without Lazarus
On Tue, 29 Nov 2016 20:42:36 -0500 "BobJ" wrote: >[...] > Begin web-site excerpt > > Using the LCL without Lazarus > > 1How to use the LCL without the Lazarus IDE? > 1.1Requirements > 1.2Introduction > 1.3The installation process > 1.4The settings > 1.5The code > 1.6Lazarus 1.2.6 > 2Alternatives > How to use the LCL without the Lazarus IDE? > > Requirements > Things you'll need: > . Free Pascal 2.4.4 > . Lazarus 0.9.30 That's very old. Current is FPC 3.0.0 and Lazarus 1.6.2. > Tested on Microsoft Windows XP SP3. > > Introduction > > You are not forced to use the Lazarus IDE if you want to develop with the > LCL. You can use it directly from the Free Pascal Compiler. True. >[...] > 1. I have FPC ver 3.0.0 and Lazarus ver 1.6 > Should the instructions given in the excerpt be applicable with these > versions, as well? Pretty much. Although this setup adds source paths so every program will compile the LCL, creating many copies and may result in a mess. Where did you find this? I recommend to simply install using the Lazarus installer. If you don't want to install the IDE you can do alternatively: Download and install FPC. Then download the Lazarus sources (e.g. to C:\lazarus) and build them: Make sure FPC 'bin' is in PATH environment variable, cd C:\lazarus, and execute 'make clean all'. This will build the LCL for win32, lazbuild and the IDE. Whatever you chose, next do: Add to your fpc.cfg: -FuC:\lazarus\component\lazutils\lib\i386-win32 -FuC:\lazarus\lcl\units\i386-win32 -FuC:\lazarus\lcl\units\i386-win32\win32 Do not add source or include paths - it can create a mess and strange errors. Now you can use the LCL in your programs. > 2. Is it safe to assume that when they say > "You are not forced to use the Lazarus IDE if you want to develop with the > LCL. You can use it directly from the Free Pascal Compiler." > that they mean that the source code can be submitted to FPC at the command > line? Yes. Lazarus calls FPC itself. If you use some Lazarus packages, you can build them using lazbuild. Then add the directories containing the ppu files to your fpc.cfg, and *only* those directories. > 3. As I stated somewhere above, the FP IDE is not accessable at a practical > level so, is there some other way that I can satisfy the requirements to do > the following? > > Start the FP IDE (included with FPC). >[...] I leave this open for others. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] For..in enumerator for generic records?
I just tried this really quick and it doesn’t seem to work with records but if I changed it to a class that worked. Maybe I should use an object instead so it’s stored on the stack like a record? Not very important it can enumerate but I wanted to try first. > On Nov 30, 2016, at 5:53 PM, Ryan Joseph wrote: > > There’s a class nested inside a class?? I never saw that before. What are all > the inlines for btw? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] For..in enumerator for generic records?
There’s a class nested inside a class?? I never saw that before. What are all the inlines for btw? > On Nov 30, 2016, at 3:09 PM, Sven Barth wrote: > > Take a look at packages/fcl-stl/src/gvector.pp, it's a generic vector > container that provides an enumerator. > > Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] For..in enumerator for generic records?
On 2016-11-30 10:53, Ryan Joseph wrote: > There’s a class nested inside a class?? I never saw that before. Yeah, those were introduced in FPC 3.0.0 I believe - more Delphi compatibility changes. I still don’t know if I like it though, but understand its usage is meant if two classes are very close related. You can now have nested classes (god knows how deep), constants, vars etc all inside a class definition. The Delphi version of the Object Pascal language is becoming pretty messy. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] For..in enumerator for generic records?
In our previous episode, Graeme Geldenhuys said: > Yeah, those were introduced in FPC 3.0.0 D2006/ FPC 2.6.0 from 2.6.0 release manifest: http://forum.lazarus.freepascal.org/index.php?topic=15656.0 * Delphi compatibility mode improvements * Nested types, class variables and class local constants * Advanced records syntax (no constructors yet) * (for..in) Enumerators in records * Class and record helpers * Generic records, arrays and procedural types * Delphi-compatibility of generics improved * Scoped enumerations * Custom messages for "deprecated" directive * Ability to use "&" for escaping keywords ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] For..in enumerator for generic records?
On 2016-11-30 04:03, Ryan Joseph wrote: > I have a generic record I would like to enumerate using for..in loops. Maybe generics are redefining this, but a record (as I understand it) is something like TMyRec = record StrField: string; IntField: integer; BoleanField: boolean; end; What would you iterate/enumerate in that? I can understand iterating an "array of TMyRec", but not TMyRec itself. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] For..in enumerator for generic records?
On 2016-11-30 11:22, Marco van de Voort wrote: > D2006/ FPC 2.6.0 Thanks for the correction Marco. Wow, that long ago already. Regards, Graeme ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] For..in enumerator for generic records?
> On Nov 30, 2016, at 6:24 PM, Graeme Geldenhuys > wrote: > > What would you iterate/enumerate in that? I can understand iterating an > "array of TMyRec", but not TMyRec itself. I have a dynamic array inside a record. I’m using a record instead of a class because I want it to be stored on the stack. It’s trivial to just enumerate the array inside the record but I wanted to try the more elegant solution of making an enumerator for the record. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] For..in enumerator for generic records?
> On Nov 30, 2016, at 6:22 PM, Marco van de Voort wrote: > > * (for..in) Enumerators in records Where’s an example of this? I’m trying it with a generic record and I can’t it to compile so I’m not sure if this is supported or not. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] For..in enumerator for generic records?
> On Nov 30, 2016, at 6:19 PM, Graeme Geldenhuys > wrote: > > Yeah, those were introduced in FPC 3.0.0 I believe - more Delphi > compatibility changes. I still don’t know if I like it though, but > understand its usage is meant if two classes are very close related. You > can now have nested classes (god knows how deep), constants, vars etc > all inside a class definition. The Delphi version of the Object Pascal > language is becoming pretty messy. Big mess indeed. I can wrap my head around nested types in classes because they’re necessary for generics I just learned but nested classes feel messy. Is there at least some namespace protection? That would be a benefit I suppose if the class was only ever used inside that class but a unit may be a better option in that case. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] For..in enumerator for generic records?
On Wed, 30 Nov 2016 18:24:11 +0700 Ryan Joseph wrote: >[...] I can wrap my head around nested types in classes because they’re >necessary for generics I just learned but nested classes feel messy. Is there >at least some namespace protection? Yes. And it follows visibility rules. > That would be a benefit I suppose if the class was only ever used > inside that class but a unit may be a better option in that case. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Using the LCL without Lazarus
Hello. > My attempts to use the following software has proven to be unsuccessful > because of the "unfriendly" nature of their video displays: > IDEU IDE What do you mean with "unfriendly" nature of their video displays" ? Did you enable "Voice Assisted" feature of ideU ? What would you want to make ideU more friendly assisted ? I am open for any suggestions. PS: MSEgui has a perfectly working assisted interface. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Using-the-LCL-without-Lazarus-tp5726979p5726994.html Sent from the Free Pascal - General mailing list archive at Nabble.com. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] For..in enumerator for generic records?
> I just tried this really quick and it doesn’t seem to work with records but if I changed it to a class that worked. Just as you can't declare next field to be a record when learning linked list (well, we normally learned that some time in the past), the solution is just the same here: declare and use pointer to the record instead. Using classes, however, the pointer can be abstracted and you will have less messy code. -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/For-in-enumerator-for-generic-records-tp5726980p5726995.html Sent from the Free Pascal - General mailing list archive at Nabble.com. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Using the LCL without Lazarus
Terrific response, many thanks! I'll see what I can do... Bob -- From: "Mattias Gaertner" Sent: Wednesday, November 30, 2016 3:45 AM To: Subject: Re: [fpc-pascal] Using the LCL without Lazarus On Tue, 29 Nov 2016 20:42:36 -0500 "BobJ" wrote: [...] Begin web-site excerpt Using the LCL without Lazarus 1How to use the LCL without the Lazarus IDE? 1.1Requirements 1.2Introduction 1.3The installation process 1.4The settings 1.5The code 1.6Lazarus 1.2.6 2Alternatives How to use the LCL without the Lazarus IDE? Requirements Things you'll need: . Free Pascal 2.4.4 . Lazarus 0.9.30 That's very old. Current is FPC 3.0.0 and Lazarus 1.6.2. Tested on Microsoft Windows XP SP3. Introduction You are not forced to use the Lazarus IDE if you want to develop with the LCL. You can use it directly from the Free Pascal Compiler. True. [...] 1. I have FPC ver 3.0.0 and Lazarus ver 1.6 Should the instructions given in the excerpt be applicable with these versions, as well? Pretty much. Although this setup adds source paths so every program will compile the LCL, creating many copies and may result in a mess. Where did you find this? I recommend to simply install using the Lazarus installer. If you don't want to install the IDE you can do alternatively: Download and install FPC. Then download the Lazarus sources (e.g. to C:\lazarus) and build them: Make sure FPC 'bin' is in PATH environment variable, cd C:\lazarus, and execute 'make clean all'. This will build the LCL for win32, lazbuild and the IDE. Whatever you chose, next do: Add to your fpc.cfg: -FuC:\lazarus\component\lazutils\lib\i386-win32 -FuC:\lazarus\lcl\units\i386-win32 -FuC:\lazarus\lcl\units\i386-win32\win32 Do not add source or include paths - it can create a mess and strange errors. Now you can use the LCL in your programs. 2. Is it safe to assume that when they say "You are not forced to use the Lazarus IDE if you want to develop with the LCL. You can use it directly from the Free Pascal Compiler." that they mean that the source code can be submitted to FPC at the command line? Yes. Lazarus calls FPC itself. If you use some Lazarus packages, you can build them using lazbuild. Then add the directories containing the ppu files to your fpc.cfg, and *only* those directories. 3. As I stated somewhere above, the FP IDE is not accessable at a practical level so, is there some other way that I can satisfy the requirements to do the following? Start the FP IDE (included with FPC). [...] I leave this open for others. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] SysSetCtrlBreakHandler
On Tue, Nov 29, 2016 at 5:13 PM, Tomas Hajny wrote: > > 1) Instead of using the special handler registered via > SetConsoleCtrlHandler (invoked in a special thread), isn't it possible to > process this event in the exception handler (running in the same thread > probably)? > Not that I'm (or MSDN) aware of. Instead there is a flag ENABLE_PROCESSED_INPUT that's on by default for a console. It would suppress the handler for Ctrl+C and would pass it as a regular key combination (bringing the desired #3 keychar). (as I noted in my comment in the bug tracker, clearing ENABLE_PROCESSED_INPUT flag was used originally. See TurnMouseOff procedure. However it was removed at some point, causing the regression?) Windows is raising an exception only if a process is being debugged, so a debugger would be aware of it. That's the only time, whenever the exception is used. MSDN however doesn't specify at what thread the exception is risen. So the newest patch removes all threading-related concerns. thanks, Dmitry ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Using the LCL without Lazarus
Hello, Sent by: "fredvs" Sent: Wednesday, November 30, 2016 9:12 AM PS: MSEgui has a perfectly working assisted interface. Thanks, I will take a "look" at that, bearing in mind that sighted folks often over estimate how usable anything will be for non-sighted folks. What do you mean with "unfriendly" nature of their video displays" ? In my experience, I have come to believe that there must be more than one technique for providing an editable field or editable screen shown on the video display. In support of that belief I offer the fact that I can use the Windows NotePad text-editor to enter thousands of characters, review any of those characters or alter any of them with no difficulty and both of the screen-readers at my disposal provide flawless feedback regarding the identity of every character. On the other hand, there exists other software packages which must be providing those editable areas via some technique other than that used by the NotePad program because neither of my screen-readers can provide any bit of feedback regarding what might appear there and neither can either screen-reader enable me to enter any type of characters therein. I only know that which I have just explained, knowing nothing about the how's and why's of it. Did you enable "Voice Assisted" feature of ideU ? Yes, after much trial and error or, probably more accurately, much trial and failure. Evidently, IDEU defaults to an environment other than Windows because the default path to the folder containing the text-to-speech package contains slash characters instead of back-slashe characters. Naturally, that fact requires that the edit field provided to edit or enter the appropriate path name must be edited. Neither of my screen-readers could enable me to delete or edit characters from that field. Eventually I navigated to that desired folder, used one screen-reader to copy the path to the Windows clipboard, then, using the other screen-reader, returned to the edit field of interest and pasted the correct path name into that field. To my amazement, that worked! So, now it talks, sometimes. If there any documentation describing how to use this feature to greatest advantage, I have yet to discover it. What would you want to make ideU more friendly assisted ? I have no idea how you have accomplished what you have done thus far, however, I fear that a great deal more work would be required to make this a truely accessible project. Besides the difficulty described immediately above, there is precious little feedback provided for common operations. For example, after I launch IDEU, if I press the key combination "Alt key + The letter F," the currently selected menu option is voiced. If I failed to understand what was spoken, I have found no means by which I can have the same announcement restated. So, I thought, I'll just press the down-arrow key where I will surely hear an announcement describing the next item on the option list under the File menu. Then, I can press the up-arrow key and I will here the same announcement that I didn't quite understand just moments before. Well, the only announcements heard when pressing the down-arrow key or the up-arrow key was "down" and then "up." I'm sure that you can appreciate that it is more important to hear the name of the newly highlighted menu option than it is to hear which arrow-key has been pressed. As for the edit screen where one would expect to enter their source code, I cannot say whether that is accessable or not because I was never able to get into one, as far as I could determine. I don't mean to sound like a harsh critic, its just obvious to me that sighted folks have no true understanding of the obstacles faced by those of us who are without any usable sight. Furthermore, as I stated earlier, if there is any documentation for the proper use of the accessability features of IDEU, perhaps such documentation would enlighten me as to how to overcome the obstacles I have described herein. If such documentation exists, please advise how and where it may be acquired. I am open for any suggestions. I wish I could offer some helpful suggestions, however, I have no idea how the authors of the existing screen-reader software packages capture the display data and pass it on to the text-to-speech engines. Suffice it to say that the two screen-readers available to me have been around for years, have been constantly updated and still they have many problems providing complete access to all that is out there. Having said all that, I would have no difficulty understanding your reluctance to attemp to perfect accessability for IDEU. Please believe that I do appreciate your interest and your efforts. Bob ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Using the LCL without Lazarus
On 12/01/2016 04:58 AM, BobJ wrote: > > Hello, > > Sent by: "fredvs" > Sent: Wednesday, November 30, 2016 9:12 AM > >> PS: MSEgui has a perfectly working assisted interface. > > Thanks, I will take a "look" at that, bearing in mind that sighted folks > often over estimate how usable anything will be for non-sighted folks. > That was my concern too when Fred started with the accessibility options for MSEgui. I suggested to use and extend the "iassistiveclient" and "iassistiveserver" interfaces of MSEgui in order to connect to standard screen readers instead to implement own reader functionality. Maybe continue the discussion on the MSEide+MSEgui mailinglist: mseide-msegui-t...@lists.sourceforge.net Registering page: https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk Martin ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal