Off topic question

Off topic question

Postby Vladimir Grigoriev » Mon Mar 20, 2006 11:05 am

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
Vladimir Grigoriev
 
Posts: 54
Joined: Fri Oct 21, 2005 10:45 am
Location: Russia, Moscow

Postby Vladimir Grigoriev » Mon Mar 20, 2006 1:19 pm

Vladimir Grigoriev
 
Posts: 54
Joined: Fri Oct 21, 2005 10:45 am
Location: Russia, Moscow

Postby Antonio Linares » Mon Mar 20, 2006 1:37 pm

Vladimir,

maybe DATA lDone ?

lDone = .t. after the search
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42127
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Vladimir Grigoriev » Mon Mar 20, 2006 2:14 pm

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
Vladimir Grigoriev
 
Posts: 54
Joined: Fri Oct 21, 2005 10:45 am
Location: Russia, Moscow

Postby Enrico Maria Giordano » Mon Mar 20, 2006 2:24 pm

lExecuted? lStarted?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Vladimir Grigoriev » Mon Mar 20, 2006 2:30 pm

Thanks Enrico.
lExecuted is more suitable.
I wil wait a little. Maybe another suggestions will be.
Vladimir Grigoriev
Vladimir Grigoriev
 
Posts: 54
Joined: Fri Oct 21, 2005 10:45 am
Location: Russia, Moscow

Postby Enrico Maria Giordano » Mon Mar 20, 2006 2:42 pm

lPerformed?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Enrico Maria Giordano » Mon Mar 20, 2006 2:42 pm

lCompleted?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Enrico Maria Giordano » Mon Mar 20, 2006 2:43 pm

lFinished?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Vladimir Grigoriev » Mon Mar 20, 2006 2:58 pm

I don't like lCompleted and lFinished on the same reason as lDone.
Also I think over lNew and something similar...
Vladimir Grigoriev
Vladimir Grigoriev
 
Posts: 54
Joined: Fri Oct 21, 2005 10:45 am
Location: Russia, Moscow

Postby Enrico Maria Giordano » Mon Mar 20, 2006 3:01 pm

lSearched?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Vladimir Grigoriev » Mon Mar 20, 2006 3:08 pm

O'k. It is more closely. :)
Vladimir Grigoriev
 
Posts: 54
Joined: Fri Oct 21, 2005 10:45 am
Location: Russia, Moscow

Postby Vladimir Grigoriev » Mon Mar 20, 2006 3:09 pm

And what about the class in whole? Any opnions?
Vladimir Grigoriev
 
Posts: 54
Joined: Fri Oct 21, 2005 10:45 am
Location: Russia, Moscow

Postby Vladimir Grigoriev » Tue Mar 21, 2006 9:08 am

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. :)
Vladimir Grigoriev
 
Posts: 54
Joined: Fri Oct 21, 2005 10:45 am
Location: Russia, Moscow

Searching

Postby grumpy » Tue Mar 28, 2006 1:55 am

Whatabout lFoundAll
grumpy
 
Posts: 48
Joined: Tue Dec 27, 2005 12:40 pm
Location: Australia

Next

Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 11 guests