Prev: Activate the first input element
Next: One Shot Timers
From: Karl E. Peterson on 1 Jul 2010 12:48 ralph expressed precisely : > is only when pcode is translated to C that a problem seems to occur. Right. Start fiddling with native code optimizations, and who knows what's going on at that point? Best to say what you mean and mean what you say for the most perfect outcomes. :-) -- ..NET: It's About Trust! http://vfred.mvps.org
From: dpb on 1 Jul 2010 16:41 Ulrich Korndoerfer wrote: .... > Unfortunately with CondA And CondB there is no subexpresssion one could > put braces around. But one could do tricks: > > CondA And (CondB And True) should result in CondB evaluated before CondA. In the subject case (assuming OP chooses not to do the right thing and refactor or otherwise resolve the side effects issue) far easier to read and workable would be either the aforementioned If Fncn() Then If SideEffect Then .... or to ensure the side effects are complete FlagVar = Fncn() If FlagVar and SideEffect Then .... Either way, I'd still strongly recommend the avoidance of the side effects in the formulation of the function 'cuz even if OP fixes up the code in this instance it'll be sure to come and bite somewhere else sooner or later (maybe as simple as seeing some kludge of the type herein and forgetting the reason). VB other than the GUI stuff being so similar in syntax and style as it is to Fortran (as well as being the language I'm most familiar with), the OP's original construct is simply illegal code of the type that is not required to be diagnosed but is documented as being non-Standard and therefore all bets are off as to what the result may be for any given compiler. IF there were a similar document for VB, I'm pretty confident it would have a similar constraint for the same reason. --
From: Claire on 1 Jul 2010 22:30
But of course. Claire "Daryl Muellenberg" <dmuellenberg(a)comcast.net> wrote in message news:uskJPCTGLHA.4824(a)TK2MSFTNGP05.phx.gbl... > > > "Claire" <replyto(a)fra> wrote in message > news:Ofp6qZ#FLHA.1996(a)TK2MSFTNGP06.phx.gbl... >> I corrected the problem by splitting the conditions: >> If rlineGetDevCaps(l) = True Then >> If LineID(l) = Val(Mid(sSelectLines, i + 4, k - i)) Then >> (some code here) >> Else >> MsgBox "Lines have changed since the last use.",... >> End If >> End If >> > > Just wanted to point out also that if rlineGetDevCaps(l) is False, then > your message will not be displayed. You have to add another Else to match > the first If in order to display your message if rlineGetDevCaps(l) is > False. > > |