Hi Chris,
> In modifying an older program, I have run across an
> instance where in the middle of a LOOP I need to
> stop and monitor a LISTBOX and deal with users
> selecting stuff in the listbox, doing some other
> stuff, then continuing the loop again when finished.
> ...
> This could possibly let me execute event code like
> LISTBOX_CLICK until I set the boolean=false, but I
> am sure I remember reading about another way to do
> it...
It really really really depends on your exact needs what you need to
fire and how you wrap it. Here's a vaporcode example:
'// ========================================================
' WARNING: Vaporcode
' This code was NEVER tested in the IDE.
' It was written directly into this email.
'// ========================================================
'[variables]
private bLooping as boolean
'[code]
sub something_click()
' check our flag
if bLooping then
' dump out if we're already in the loop
exit sub
end if
' set our flag
bLooping = true
for x = 1 to 100000000
' just act like we're doing something
if x mod 999 = 0 then debug.print "something!"
' run doevents SPARINGLY! It can eat up a lot of time
' attempting to process events that don't exist or
' aren't important
if x mod 10000 = 0 then
doevents
end if
next
' clear our flag
bLooping = false
end sub
'// ========================================================
> Also, I wanted to mention to all of you that have helped me,
> especially a year ago when I really needed it (worse), Shawn,
> Matt, Don, Ian, and others I can't recall off-hand, thanks.
:)
> You probably can't tell from my recent posts, but those past
> projects were very successfull and I might even be able to
> get a "real" job programming some day. I just never learned
> the "right" way to do it, mainly due to never having any
> real training (unless you count pascal in high school,
> GWBASIC, and quick basic)...
That's more than me. I started out with no experience and an order
from an officer. I went to school to become a paramedic instructor
in the navy, when I finally got to my base (having never touched a
computer before) the personnel guy says "oh, so *you're* Hall, huh?
We've been waiting for *you.*"
To which I freaked out - after the year of crap I'd already been
through, you can imagine how nice it must be arriving to your base
to be talked to that way.
"You know anything about computers?"
"Nope."
"Oh okay. Well here's a tip," he picks up the keyboard sitting in
front of him and points nonchallantly at some place near the side of
the keys. "See that key right there? That's 'Enter' - you'll be
using it a lot where you're going." He handed me my file with a
"welcome aboard" and kicked me out of his office. It took me about
two hours to find the office of the place I was supposed to report
to. After all that dang training they stuck me working on computers.
My superiors new jack squat. My immediate superior, LtJG Michael M.
Montoya (f* idiot!) had a masters degree in computer science and
didn't know what a batch file was. Perhaps needless to say, I got to
teach myself because it sure as heck wasn't going to happen there.
Fortunately I had a T3 connection (arg arg argh arggggh) at my
personal disposal and any hardware I wanted, with what amounted to a
bottomless credit card for learning materials.
I read a lot of books. I made a lot of mistakes. Now I'm trying to
help people that *truly* want to learn and are willing to be both
respectful and "share and share alike." My personal pet peeve is the
people that only ever ask questions in groups like this. To
everyone: IF YOU CAN HELP SOMEONE - DO IT! That's the whole point of
being here!
> ...I find myself getting a project done in the hours I am
> told to have it done, which doesn't really allow me much
> room for the "professional" touches you guys suggest. I
> think my boss is starting to understand when it takes as
> long to "straighten up" a program as it did to initially
> write it maybe he should give me some more time, or at
> least warn me a little sooner when he needs a particular
> program.
As a general rule, you should always rebuild your applications from
scratch. I know, it sounds nuts, but that's why we write our code
"functionally" instead of directly within each event, right?
Rewriting from the ground up will let you review every aspect of the
application again and identify the validity and functionality of the
code. It's going to take you just as long to 'fix' a program as it
would to rewrite it, and rewriting it you get to correct all the
bugs you didn't realize were bugs until looking at the code with the
new eyes experience gives you.
What you ought to do is dedicate a few hours each week to learning a
specific core technology, method or process that you can later
implement in your program. We should have another thread for "what
every VB dev should know."
Regards,
Shawn K. Hall
http://12PointDesign.com/
http://ReliableAnswers.com/
'// ========================================================
"Where the press is free, and every man able to read,
all is safe."
-- Thomas Jefferson
'// =======================================================
Rules : http://ReliableAnswers.com/List/Rules.asp
Home : http://groups.yahoo.com/group/vbHelp/
=======================================================
Post : [email protected]
Join : [EMAIL PROTECTED]
Leave : [EMAIL PROTECTED]
'// =======================================================
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/vbhelp/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/