Re: [Lazarus] Why doesn't this work?
On 28/11/12 10:15, Erwin van den Bosch wrote: procedure TForm1.Button1Click(Sender: TObject); var iLastError: integer; begin iLastError:=10053; if iLastError in [10053, 10054] then Label1.Caption:='Yes, it works!' else Label1.Caption:='No, it doesn''t work!'; // Output : No, it doesn''t work! end; You may be thinking of how in is used in a for..in..do loop like this procedure TForm1.Button1Click(Sender: TObject); var iLastError, j: integer; intArray: array[0..1] of integer = (10053,10054); begin iLastError:=10053; for j in intArray do if j=iLastError then begin Label1.Caption:='iLastError present'; Break; end else label1.Caption:= 'iLastError not found'; end; -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Why doesn't this work?
Op 29-11-2012 1:13, Maxim Ganetsky schreef: 29.11.2012 2:15, Erwin van den Bosch пишет: procedure TForm1.Button1Click(Sender: TObject); var iLastError: integer; begin iLastError:=10053; if iLastError in [10053, 10054] then Label1.Caption:='Yes, it works!' else Label1.Caption:='No, it doesn''t work!'; // Output : No, it doesn''t work! end; This should generate range check errors, because AFAIK sets are limited to byte values. I should have turned range checking on! Then I saved a few hours debugging :-( Thanks for your answer. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] WebLaz bug
On 2012-11-28 23:33:40 -0800, leledumbo wrote: I don't know if this bug is related to Lazarus, WebLaz or FPC. Please tell me and I'll post it on Mantis: To reproduce it, please follow this steps: 1) Create a CGI application. You'll need WebLaz package. 2) Add an FPWebModule. 3) Add two or three actions. Compile and check if they work as expected. 4) Delete the method onRequest... of one action from code, DO NOT REMOVE THE ACTION USING THE ACTIONS EDITOR, just delete the method similar to this (from interface and implementation): procedure myActionRequest(Sender: TObject; ARequest: TRequest; AResponse: TResponse; var Handled: Boolean); 5) Compile and test. When you invoke any action of this webmodule, you'll get this: Error reading XXX.Actions: Error reading TFPWebAction.OnRequest: Invalid value for property That's normal, as if you delete a generated event handler from any application (e.g. OnClick of a TButton). The resource file is not automatically updated with your changes in the code. Simply don't do such a thing, and use the actions editor, that's why it exists. Well, I wouldn't try to synchronize code with lfm, but I'd add more info to the error message, for example ...Invalid value for property A, just add the property with problems. -- Leonardo M. Ramé http://leonardorame.blogspot.com -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] WebLaz bug
for example ...Invalid value for property A A in Error reading TFPWebAction.OnRequest: Invalid is TFPWebAction.OnRequest -- View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-WebLaz-bug-tp4027787p4027794.html Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] WebLaz bug
On 2012-11-29 05:03:52 -0800, leledumbo wrote: for example ...Invalid value for property A A in Error reading TFPWebAction.OnRequest: Invalid is TFPWebAction.OnRequest Ok, OnRequest is the property. Then, it could help if the message is changed to: Invalid value (name_of_removed_method) for property TFPWebAction.OnRequest. -- Leonardo M. Ramé http://leonardorame.blogspot.com -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Source Tab duplication on Linux...
Hi, when I'm debugging a application and the debugger reach a break point, it doesn't use the already open source tab, Lazarus opens a new tab of the same file focusing the break point line. How can I change this behavior? Screen Shots: http://imagebin.org/237601 http://imagebin.org/237602 PS.: Sorry about all language errors.. -- William de Oliveira Ferreira -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Source Tab duplication on Linux...
On 30/11/2012 00:27, William Oliveira Ferreira wrote: Hi, when I'm debugging a application and the debugger reach a break point, it doesn't use the already open source tab, Lazarus opens a new tab of the same file focusing the break point line. How can I change this behavior? Screen Shots: http://imagebin.org/237601 http://imagebin.org/237602 PS.: Sorry about all language errors.. Look at the filename (with path) in the statusbar. The location differ. Maybe it is a link (lazarus does not detect links), maybe you used the other copy of the file. In any case for lazarus this are 2 diff files. The reason you can set breakpoint is that setting breakpoints has a fallback to only use the filename, without path. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Beta testers needed / Lazarus with Editor-Macro-Script
Hi, I need some testers for all the different available platforms. Because, unfortunately, I do not have every available hardware/OS myself :( I added a package called macroscript (in the components folder), there also is a modified (bug fixes) version of pascalscript (the original will not work). Only SVN trunk / 1.1 snapshot revision 39418 and up There is no need to install the package (but if the IDE does not find it, or if you used another pascalscript), then you *must* at least use open package and open it from the IDE. The package has a folder test with a testcase. When running the interactive part, take care, of pressing the right button (2 dlg want cancel). And edit the text (set to 123 for 2 out of 3 dlg) Please report your OS and CPU (including 32/64 bit) and fpc version along with test results. Sofar I tested: - Win Vista / Intel 32 bit / fpc 2.6.0 - Win Vista / Intel 32 bit / fpc trunk (recent, last 7 days) - Win XP / Intel 64 bit / fpc 2.6.0 - Linux, fedora 13 / Intel 32 bit / fpc 2.6.0 - Mac OS / Intel 32 bit / fpc 2.6.0 -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Source Tab duplication on Linux...
Thanks for the hint! 2012/11/29 William Oliveira Ferreira bdexterholl...@gmail.com 2012/11/29 Martin laza...@mfriebe.de Look at the filename (with path) in the statusbar. The location differ. Maybe it is a link (lazarus does not detect links), maybe you used the other copy of the file. In any case for lazarus this are 2 diff files. I didn't created any copy file on this situation but i neither noticed that the file name differs on the statusbar. Today, I use an extra partition to store my docs and source-codes and I also created some symbolic links that points to these folders inside user's folder to easely to access my files on some situations... -- William de Oliveira Ferreira -- William de Oliveira Ferreira -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Source Tab duplication on Linux...
You also wont to check the lps (session) file (may be in your main config folder). Now that it knows both pathes, there may be references. Simpl gcep for the path, you do not ant to open On 30/11/2012 01:36, William Oliveira Ferreira wrote: Thanks for the hint! 2012/11/29 William Oliveira Ferreira bdexterholl...@gmail.com mailto:bdexterholl...@gmail.com 2012/11/29 Martin laza...@mfriebe.de mailto:laza...@mfriebe.de Look at the filename (with path) in the statusbar. The location differ. Maybe it is a link (lazarus does not detect links), maybe you used the other copy of the file. In any case for lazarus this are 2 diff files. I didn't created any copy file on this situation but i neither noticed that the file name differs on the statusbar. Today, I use an extra partition to store my docs and source-codes and I also created some symbolic links that points to these folders inside user's folder to easely to access my files on some situations... -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus