Re: [lazarus] Parameter not used ...
Vincent Snijders wrote: Geno Roupsky wrote: There are very few situations where the sender is nil and still if you expect such a case you can always write something like: Assert((Sender = nil) or (Sender nil)); I will try to implement an option in the IDE to ignore this hint (similar to the unit not used hint). Done. Vincent _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Parameter not used ...
Assert(True) will raise another hint?2006/2/25, Vincent Snijders [EMAIL PROTECTED]: Vincent Snijders wrote: Geno Roupsky wrote: There are very few situations where the sender is nil and still if you expect such a case you can always write something like: Assert((Sender = nil) or (Sender nil)); I will try to implement an option in the IDE to ignore this hint (similar to the unit not used hint).Done. Vincent_ To unsubscribe: mail [EMAIL PROTECTED] withunsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives-- Atenciosamente,Alexsander da Rosa
Re: [lazarus] Parameter not used ...
Geno Roupsky wrote: a nicer workaroung is this Assert(Sender nil); Thanks :) this could do the trick. _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Parameter not used ...
On Fri, 24 Feb 2006 11:07:11 +0200 Geno Roupsky [EMAIL PROTECTED] wrote: a nicer workaroung is this Assert(Sender nil); as this will produce code only if assertion is turned on and this is not the case with production builds. Good idea. I added this an example for an IDE QuickFix item. Just install the package lazarusdir/examples/idequickfix/quickfixexample.lpk and you can now fix 'parameter Sender not used' messages easily by right clicking. Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Parameter not used ...
Just to confirm: the Assert workaround with assertions turned off will avoid the hint AND will not generate code, right? If so, this is better than any other workaround! But anyway it would be nicer if FPC could have a flag to ignore this specific hint when the parameter is a specific string (Sender in this case). Like -some-letter Sender.2006/2/24, Andreas Berger [EMAIL PROTECTED]: Geno Roupsky wrote: a nicer workaroung is this Assert(Sender nil);Thanks :) this could do the trick._ To unsubscribe: mail [EMAIL PROTECTED] withunsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives-- Atenciosamente,Alexsander da Rosa
Re: [lazarus] Parameter not used ...
There are very few situations where the sender is nil and still if you expect such a case you can always write something like: Assert((Sender = nil) or (Sender nil));2006/2/24, Vincent Snijders [EMAIL PROTECTED]: Andreas Berger wrote: Geno Roupsky wrote: a nicer workaroung is this Assert(Sender nil); Thanks :) this could do the trick.That is, until somebody actually compiles that code with assertions enabled and Sender=nil. ;-)Vincent._ To unsubscribe: mail [EMAIL PROTECTED] withunsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives -- Geno Roupsky
Re: [lazarus] Parameter not used ...
Geno Roupsky wrote: There are very few situations where the sender is nil and still if you expect such a case you can always write something like: Assert((Sender = nil) or (Sender nil)); or Assert(True or (Sender=nil)). But it remains ugly, IMHO. I will try to implement an option in the IDE to ignore this hint (similar to the unit not used hint). Vincent _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Parameter not used ...
On 2/21/06, Andreas Berger [EMAIL PROTECTED] wrote: I know that this question should go to FPC, but since I am not on that mailing list I am hoping some kind soul will answer this here :-) When I compile a Lazarus project from the command line I get a HINT for every parameter not used in the method. This is ok if it is my method, but methods used by events must have these parameters to work. I know I can use the {$HINTS OFF} option to disable all hints, but that is not really a good idea. Is there any way to disable only that one specific hint? not really what you are asking but ... i've noted, in bits of sample source, that some people do : if(Sender = Nil) Then ; ... at the top of the event procedure. it took me a little while to realize why people were putting this into their event procedures. it seems strange to me to inject extra ops into your code to avoid a compiler hint ... but what do i know. Regards, Andreas Tony -- X-SA user ? 0.4 is out ! http://x-plane.dsrts.com http://games.groups.yahoo.com/group/x-plane-foo/ _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Parameter not used ...
Hi, Am Dienstag, den 21.02.2006, 17:45 + schrieb Tony Pelton: On 2/21/06, Andreas Berger [EMAIL PROTECTED] wrote: I know that this question should go to FPC, but since I am not on that mailing list I am hoping some kind soul will answer this here :-) When I compile a Lazarus project from the command line I get a HINT for every parameter not used in the method. This is ok if it is my method, but methods used by events must have these parameters to work. I know I can use the {$HINTS OFF} option to disable all hints, but that is not really a good idea. Is there any way to disable only that one specific hint? not really what you are asking but ... i've noted, in bits of sample source, that some people do : if(Sender = Nil) Then ; ... at the top of the event procedure. it took me a little while to realize why people were putting this into their event procedures. in C they do just sender;, much worse :) it seems strange to me to inject extra ops into your code to avoid a compiler hint ... but what do i know. yeah.. weird :) That hint about unused parameters is well-meant, but it will just always spam the programmer with spurious things :) It probably would be nice to be able to turn them (only them) off as a compiler setting, yeah... (and, arguably, those hints turned off by default) Regards, Andreas Tony cheers, Danny _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Parameter not used ...
Danny Milosavljevic wrote: Hi, Am Dienstag, den 21.02.2006, 17:45 + schrieb Tony Pelton: On 2/21/06, Andreas Berger [EMAIL PROTECTED] wrote: I know that this question should go to FPC, but since I am not on that mailing list I am hoping some kind soul will answer this here :-) When I compile a Lazarus project from the command line I get a HINT for every parameter not used in the method. This is ok if it is my method, but methods used by events must have these parameters to work. I know I can use the {$HINTS OFF} option to disable all hints, but that is not really a good idea. Is there any way to disable only that one specific hint? That hint about unused parameters is well-meant, but it will just always spam the programmer with spurious things :) It probably would be nice to be able to turn them (only them) off as a compiler setting, yeah... (and, arguably, those hints turned off by default) Ideally this hint would be disabled for all methods in the published sections and enabled for those in the public, protected and private sections. _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives