using optional arguments not present bug
  Home FAQ Contact Sign in
 
Advanced search
MATCHING GROUPS



more...
POPULAR GROUPS

more...

found 56 articles for 0.049 sec
Re: using optional arguments not present (bug)     

Group: comp.lang.fortran · Group Profile · Search for using optional arguments not present bug in comp.lang.fortran
Author: Rich Townsend
Date: Nov 30, 2006 15:32

...> A common bug in my code is to mistakenly use an optional argument that is... subroutine foo(i) integer, intent(in), optional :: i integer :: i_ if (present(i)) then i_ = i else i_ = 0 ... The "print*,i" code does not look wrong in isolation, so I find ... for the use of an optional argument not wrapped within an if(present(variable)) ...
Show full article (1.10Kb) · Show article thread
Re: using optional arguments not present (bug)     

Group: comp.lang.fortran · Group Profile · Search for using optional arguments not present bug in comp.lang.fortran
Author: Paul van Delst
Date: Nov 30, 2006 14:57

...bug in my code is to mistakenly use an optional argument...subroutine foo(i) integer, intent(in), optional :: i integer :: i_ if...The "print*,i" code does not look wrong in isolation, so...use of an optional argument not wrapped within an if(present...my pointer-containing derived type argument intents are OUT when I...length of the way. I haven't used fUnit for generating...
Show full article (1.46Kb) · Show article thread
using optional arguments not present (bug)     

Group: comp.lang.fortran · Group Profile · Search for using optional arguments not present bug in comp.lang.fortran
Author: Beliavsky
Date: Nov 30, 2006 14:26

A common bug in my code is to mistakenly use an optional argument that is ... as in subroutine foo(i) integer, intent(in), optional :: i integer :: i_ if (present(i)) then i_ = i else i_ = 0 ... subroutine foo The "print*,i" code does not look wrong in isolation, so I find ...for the use of an optional argument not wrapped within an if(present(variable)) ...
Show full article (0.90Kb)
Re: using optional arguments not present (bug)     

Group: comp.lang.fortran · Group Profile · Search for using optional arguments not present bug in comp.lang.fortran
Author: Richard Edgar
Date: Dec 1, 2006 07:50

...variable if the actual isn't present. Back many years ago, when I...syntax already: subroutine foo (optarg) integer, optional :: optarg = 0 Personally, I'd ... value is what?) Modula 3 uses a similar synatx: PROCEDURE BN2Text( ...: BigNum; isFirst := TRUE ) If the argument 'isFirst' is omitted, then you ...t accidentally modify an INTENT(IN), OPTIONAL argument (as you can in ...
Show full article (1.56Kb) · Show article thread
Re: using optional arguments not present (bug)     

Group: comp.lang.fortran · Group Profile · Search for using optional arguments not present bug in comp.lang.fortran
Author: glen herrmannsfeldt
Date: Nov 30, 2006 19:42

Steve Lionel wrote: (snip on optional arguments) Heck, we even have the syntax already: subroutine foo (optarg) integer, optional :: optarg = 0 R puts it in the...d find this easier to explain and use than a dynamically created local variable ... is what?) In OS/360 Fortran, scalar arguments are static local variables. Not that there are optional arguments, but the effects ...
Show full article (0.79Kb) · Show article thread
Re: using optional arguments not present (bug)     

Group: comp.lang.fortran · Group Profile · Search for using optional arguments not present bug in comp.lang.fortran
Author: nospam
Date: Nov 30, 2006 17:49

... nearly all my procedures have an optional argument "message_log" which is passed to a message display routine. If it's not present, output is to stdout, ... based on the value of an argument, with non-prtesence being equivalent to..., I'd have something like Use the file name if it is...for blank only if it was present. -- Richard Maine | Good judgement comes ...
Show full article (2.00Kb)
Re: using optional arguments not present (bug)     

Group: comp.lang.fortran · Group Profile · Search for using optional arguments not present bug in comp.lang.fortran
Author: nospam
Date: Nov 30, 2006 16:04

...variable if the actual isn't present.... But doesn't this "delocalise" ... all my procedures have an optional argument "message_log" which is passed ... display routine. If it's not present, output is to stdout, ... the name specified in the optional arg. If the main routine ... is that you can use the present() intrinsic on it. I ... they are passed as actual arguments. That's inherent in all ...
Show full article (2.41Kb)
Re: using optional arguments not present (bug)     

Group: comp.lang.fortran · Group Profile · Search for using optional arguments not present bug in comp.lang.fortran
Author: Paul van Delst
Date: Nov 30, 2006 15:37

... to substitute for a non-present actual is extremely common. I've ...the actual was not present. You'd then just be using the ... main call sub !-- Note no arguments. contains subroutine sub(x) real, ... local_if_missing above; that's definitely not an actual syntax proposal. The ... all my procedures have an optional argument "message_log" which is passed ...
Show full article (3.18Kb) · Show article thread
Re: using optional arguments not present (bug)     

Group: comp.lang.fortran · Group Profile · Search for using optional arguments not present bug in comp.lang.fortran
Author: nospam
Date: Nov 30, 2006 15:11

...variable to substitute for a non-present actual is extremely common. I've...have an attribute for an optional dummy argument that makes the dummy argument...the actual was not present. You'd then just be using the ... main call sub !-- Note no arguments. contains subroutine sub(x) real, ...for local_if_missing above; that's definitely not an actual syntax proposal. The ...
Show full article (2.40Kb)
Re: using optional arguments not present (bug)     

Group: comp.lang.fortran · Group Profile · Search for using optional arguments not present bug in comp.lang.fortran
Author: nospam
Date: Nov 30, 2006 14:52

... <beliavsky@aol.com> wrote: A common bug in my code is to mistakenly use an optional argument that is not present. At the beginning..., which would reduce the chance of using the wrong one. Also, since the copy...you would be very unlikely to accidentally use. But both of those proposals have effects... of the routine in question. Dummy argument names matter for keyword forms of ...
Show full article (1.44Kb)
1 · 2 · 3 · 4 · 5 · 6 · next