From: Webbiz on
On Fri, 05 Mar 2010 09:48:41 -0600, ralph <nt_consulting64(a)yahoo.net>
wrote:

>On Thu, 04 Mar 2010 16:53:11 -0600, Webbiz <nospam(a)noway.com> wrote:
>
>>On Thu, 04 Mar 2010 09:53:03 +0000, Dee Earley
>><dee.earley(a)icode.co.uk> wrote:
>>
>>>On 03/03/2010 20:14, Webbiz wrote:
>>>> Over the last months/years, I've been shown some simple approaches to
>>>> debugging here for which I'm grateful.
>>>
>>>Further to the other answers, this page explains some other general
>>>debugging concepts:
>>>http://hashvb.earlsoft.co.uk/Debugging
>>
>>
>>Thanks Dee.
>>
>>In the 19 years I've been using VB (yep, since 1991 when I switched
>>from Delphi), not only am I still a novice but I have NEVER, EVER used
>>the # debugging code stuff nor found the time to learn about it.
>>
>>Life just goes by way too fast. Guess now I'd better get to it.
>>
>>:-)
>>Webbiz
>
>To add to the list.
>
>Originally you talked about line and functional profiling. Both of
>these are usually implement through 'instrumentation' - ie, adding
>code to provide a trace. As profiling almost always adds 'Heisenbugs'
>and to the amount of time to run a test, such intrumentation is
>normally wrapped with Conditional Compiles allowing you to turn it on
>or off for particular threads or modules.
>
>Probably the most useful application of conditional compile statements
>is to work around the annoying "case bug" with VB6 Enums.
> Public Enum E_Junk
> lJunk As Long
> sJunk As String
> End Enum
> #If 0 Then ' to preserve case
> Dim lJunk, sJunk
> #EndIf
>
>I also use them in more complex scenarios where I'm trying out
>different code blocks or paths during development. Normally one can
>just comment/uncomment code. But if the alternatives are long or
>exclusive it is often too d*mn easy to forget a line here and there.
>So I like to place alternatives within discrete blocks and turn them
>off and on.
>
>-ralph


Lost me on this.

Webbiz
From: Dee Earley on
On 05/03/2010 18:39, Webbiz wrote:
> On Fri, 05 Mar 2010 09:58:27 +0000, Dee Earley
> <dee.earley(a)icode.co.uk> wrote:
>> I also use it for a particular component that I need to be able to
>> insert lots of small chunks of code for ease of development, but never
>> want to be in a released version so the flag is part of the vbp that I
>> double check when I check in the changes.
>
> When you are about to release your code, do you go through and delete
> all those #conditional snippets or just leave them in there?

I leave them there.
If I was to go through and remove them, it would defeat the entire point
of the conditional compile statements :)
They are not compiled in at all of they are not specified so don't have
any negative effect on the code.

--
Dee Earley (dee.earley(a)icode.co.uk)
i-Catcher Development Team

iCode Systems
From: Karl E. Peterson on
Webbiz wrote:
> Karl E. Peterson <karl(a)exmvps.org> wrote:
>> Webbiz wrote:
>>> In the 19 years I've been using VB (yep, since 1991 when I switched
>>> from Delphi), not only am I still a novice but I have NEVER, EVER used
>>> the # debugging code stuff nor found the time to learn about it.
>>
>> Wow, well, there was one period where I found conditional compilation
>> invaluable -- the transition from 16 to 32bits. I could write code
>> that'd drop into either environment. Very nice. Haven't had a lot of
>> use for it otherwise, though. Good to know about.
>
> Why do you say that you "haven't had a lot of use for it
> otherwise..."?
>
> I'm not doing any 'transistions' from 16 to 32. So why then would it
> be good to know? I'm asking because I know you're a VB PRO, and if a
> 'pro' doesn't find much use for it, I have to wonder if my time is
> best spent otherwise?

Most of my "conditions" aren't known at compile time. 16 or 32-bits
were, of course. I also use it sometimes to branch to different code
if I'm in VBA than in VB5/6. But that's just the way I tend to work,
which I recognize everyone does differently. It's a great thing to
know about. Like Choose(). I don't use that a lot, either, but I have
on occassion and liked it when I did.

--
..NET: It's About Trust!
http://vfred.mvps.org


From: Karl E. Peterson on
Karl E. Peterson wrote:
> Webbiz wrote:
>> In the 19 years I've been using VB (yep, since 1991 when I switched
>> from Delphi), not only am I still a novice but I have NEVER, EVER used
>> the # debugging code stuff nor found the time to learn about it.
>
> Wow, well, there was one period where I found conditional compilation
> invaluable -- the transition from 16 to 32bits. I could write code that'd
> drop into either environment. Very nice. Haven't had a lot of use for it
> otherwise, though. Good to know about.

Another use I forgot about -- debug builds. For those things that only
replicate in an EXE, you can include oodles of code to output
intermediate results, and so on, but only when the switch is thrown at
compile time. Again, it's not something I do often, but have found
invaluable at times in the past.

--
..NET: It's About Trust!
http://vfred.mvps.org


From: Nobody on
"MM" <kylix_is(a)yahoo.co.uk> wrote in message
news:5t4cp5dttc4sbh8rh41qpnbbmhgjejr049(a)4ax.com...
> But my novel idea is to use a tree! Six years ago I wrote a small
> database with a tree interface for the purposes of collating all
> aspects of my family tree. But I have also used the same system for
> collating other kinds of data, such as the contents of my house and
> garage, and it works very well. I simply copy and rename the mdb,
> delete existing data, change a few bits and pieces in the shortcut and
> I'm up and running with a new, clean tree.

This reminds me of a freeware called KeyNote. It's basically a text editor
with tabs and TreeView on the left to allow you to type text in categories
and save everything in one file. You can name the tabs and categories
whatever you wish, they are saved in the file. See the screenshots here:

http://www.tranglos.com/free/keynote_screenshot.html
http://www.tranglos.com/free/keynote.html

It was discontinued by the author, but others continued its development. You
can download the latest version from here:

http://code.google.com/p/keynote-nf/


First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10 11
Prev: Redirection
Next: Correct Way To Wait