Page 1 of 2

Off topic question

Posted: Mon Mar 20, 2006 11:05 am
by Vladimir Grigoriev
Hi.
I am writing a class on pure Clipper for searching files (including LFN files) on disk. (A simple intermediate demo I have included)
The class is based on well-known DOS functions FindFirstFile and FindNextFile.
My question is about naming conversion. I need a help from english-spoken men. How is better to name an instant variable? I will try to explain my idea.
A class object can be in two state. One state is when there is not any seach method executed yet. And another state is when at least one search method was executed. For example

The first state

DEFINE FILESEEK oFileSeek FILESPEC cFileSpec SEARCH ATTRIBUTE "D" LFN

The second state

DEFINE FILESEEK oFileSeek FILESPEC cFileSpec SEARCH ATTRIBUTE "D" LFN

oFileSeek:search() // i.e in this case at least one searching is done

So how to name a logical variable which will say if at least one searching is done or not?

Vladimir Grigoriev

Posted: Mon Mar 20, 2006 1:19 pm
by Vladimir Grigoriev
Here is URL for downloading the (very simple) example.
http://hyperupload.com/download/f5d4dc8 ... O.EXE.html
http://hyperupload.com/download/9298168 ... O.PRG.html

Vladimir Grigoriev.

Posted: Mon Mar 20, 2006 1:37 pm
by Antonio Linares
Vladimir,

maybe DATA lDone ?

lDone = .t. after the search

Posted: Mon Mar 20, 2006 2:14 pm
by Vladimir Grigoriev
Thanks Antonio.
However IMHO lDone may be incorrectly understood.
For example, a program searches in cycle all files whish are started with "somefiles*". And lDone may be interpretated that there is nothing more to search i.e we found all we want.
But I would like to say with the instant variable that no any search method was executed. That I only defined an object but did not yet do any real seaching.
Vladimir Grigoriev

Posted: Mon Mar 20, 2006 2:24 pm
by Enrico Maria Giordano
lExecuted? lStarted?

EMG

Posted: Mon Mar 20, 2006 2:30 pm
by Vladimir Grigoriev
Thanks Enrico.
lExecuted is more suitable.
I wil wait a little. Maybe another suggestions will be.
Vladimir Grigoriev

Posted: Mon Mar 20, 2006 2:42 pm
by Enrico Maria Giordano
lPerformed?

EMG

Posted: Mon Mar 20, 2006 2:42 pm
by Enrico Maria Giordano
lCompleted?

EMG

Posted: Mon Mar 20, 2006 2:43 pm
by Enrico Maria Giordano
lFinished?

EMG

Posted: Mon Mar 20, 2006 2:58 pm
by Vladimir Grigoriev
I don't like lCompleted and lFinished on the same reason as lDone.
Also I think over lNew and something similar...
Vladimir Grigoriev

Posted: Mon Mar 20, 2006 3:01 pm
by Enrico Maria Giordano
lSearched?

EMG

Posted: Mon Mar 20, 2006 3:08 pm
by Vladimir Grigoriev
O'k. It is more closely. :)

Posted: Mon Mar 20, 2006 3:09 pm
by Vladimir Grigoriev
And what about the class in whole? Any opnions?

Posted: Tue Mar 21, 2006 9:08 am
by Vladimir Grigoriev
Yesterday I remembered about such usefull word in xBase language as Used. I thing it is a right word in the context of my class. :)

Searching

Posted: Tue Mar 28, 2006 1:55 am
by grumpy
Whatabout lFoundAll