Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.basic.visual.misc > #2146

Re: Win8 & VB6

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!.POSTED!not-for-mail
From ObiWan <obiwan@mvps.org>
Newsgroups comp.lang.basic.visual.misc, microsoft.public.vb.general.discussion
Subject Re: Win8 & VB6
Date Fri, 29 Aug 2014 12:59:48 +0200
Organization -
Lines 38
Message-ID <20140829125948.00000dd7@albasani.net> (permalink)
References <lto8fv$jna$1@dont-email.me> <20140829095319.000000c1@albasani.net> <ltphka$n69$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-Trace news.albasani.net j/rLWr7VrrpLPL/4hb2KYnDBvhHrlye9P45i0QhiM6Xlq4v0okPo3W8OwUpJVyF7qh2Z5WUf0i6d+WFwqQ6oTg==
NNTP-Posting-Date Fri, 29 Aug 2014 10:59:48 +0000 (UTC)
Injection-Info news.albasani.net; logging-data="qmGOyEpT7S9RDRSd44QKmrAlkqih7sLbip3nbYgoBoBQ3w297dmQhHp4XiS1YP2CoZSfOK5eCHc/Yr06eiZ8lBzpXppwsCIJ7bQIxELVT1+QfK4d3yaq8rQzCPVObwTv"; mail-complaints-to="abuse@albasani.net"
X-Face '%"Gs_@!S`5k|d-/\-[K~kJB#HoT1:4|68{~!{dkHfdj/ZyKhVz2s{[/*AW<{9=wE}?G6)%cv.gc)=h-&AO<<Uxlt:C)NOF:iK];{lX+V\~b>Dn'v_xX3r7+%%Jt3yzk\+=1&as/<(g:/Q1\QFT~E3WK@FkRejldy/|a3@%n>,@*%yW3tz0GJg,U
Cancel-Lock sha1:V8PUHOBX3YnZgRzbmLRAyxvgMEM=
Xref csiph.com comp.lang.basic.visual.misc:2146

Cross-posted to 2 groups.

Show key headers only | View raw


:: On Fri, 29 Aug 2014 05:37:10 -0400
:: (comp.lang.basic.visual.misc,microsoft.public.vb.general.discussion)
:: <ltphka$n69$1@dont-email.me>
:: GS <gs@somewhere.net> wrote:

> > it as a semaphore; for example
> >
> > Sub Form_Activate()
> >   Static bFirstTime As Boolean
> >
> >   If Not bFirstTime Then
> >     bFirstTime = True
> >     txtLicenseKey.SetFocus
> >   End If
> > End Sub
> 
> Thank you.., that's a great idea! As it happens, the code is about 10 
> years old but the Form has been revised from a multi-use component to

just in case, change the code this way

Sub Form_Activate()
  Static bInitFlag As Boolean

  ' enter only once
  If bInitFlag Then Exit Sub
  bInitFlag = True

  ' add here your one time code
  txtLicenseKey.SetFocus
  '....more code....
End Sub


not that the other code is wrong, but I think the above is cleaner and
avoids wrapping the "one time" code inside the "if" block :)

Back to comp.lang.basic.visual.misc | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Win8 & VB6 GS <gs@somewhere.net> - 2014-08-28 17:55 -0400
  Re: Win8 & VB6 john@jeasonNoSpam.cix.co.uk (John K.Eason) - 2014-08-28 23:58 +0100
    Re: Win8 & VB6 GS <gs@somewhere.net> - 2014-08-28 20:46 -0400
      Re: Win8 & VB6 GS <gs@somewhere.net> - 2014-08-28 20:49 -0400
    Re: Win8 & VB6 GS <gs@somewhere.net> - 2014-08-28 20:58 -0400
      Re: Win8 & VB6 john@jeasonNoSpam.cix.co.uk (John K.Eason) - 2014-08-29 12:16 +0100
        Re: Win8 & VB6 GS <gs@somewhere.net> - 2014-08-29 07:42 -0400
  Re: Win8 & VB6 ObiWan <obiwan@mvps.org> - 2014-08-29 09:53 +0200
    Re: Win8 & VB6 GS <gs@somewhere.net> - 2014-08-29 05:37 -0400
      Re: Win8 & VB6 GS <gs@somewhere.net> - 2014-08-29 05:44 -0400
      Re: Win8 & VB6 ObiWan <obiwan@mvps.org> - 2014-08-29 12:59 +0200
        Re: Win8 & VB6 GS <gs@somewhere.net> - 2014-08-29 07:55 -0400

csiph-web