Home » Archives » February 2004 » Some old-school-ic filterin' code

[ Previous entry: Supercomputers and the human brain... ]
[ Next entry: DeviantArt and pixels ]
02/23/2004:

Some old-school-ic filterin' code


Early dawn-worm-code snippet:

if .chkMonth.value != 0 .and. !isblank(.cmbMonth.value)
cFilterDate = upper(alltrim(.cmbMonth.value))
cFilterYear = "(year(DATAAMPM.DATE) == year(date()))"
cFilter = "(upper(alltrim(cmonth(DATAAMPM.DATE))) == cFilterDate)"
cFilter = cFilter + " .and. " + cFilterYear
**' cFileName = cFilterDate + alltrim(str(year(date())))

dDate = cFilterDate + alltrim(str(year(date())))
report form Report_AMPM preview for &cFilter
else
cMess = 'Please specify the month first' + chr(13) + ;
'and check the Monthly Report filter'
messagebox(cMess)
endif
One... the above code is not 'extremely optimized' and was done around 2:16AM. So get over it.

Two... I'm just testing the preformatted tag and the colors. I recall someone blogging about a tool that 'autocolorizes' code in blogs, but I just can't remember the URL. At two in the morning I don't want to be involve in any searches.

Three it's nice to know that the ELSE statement functions as 'Everything Else' in most programming language. Foxpro included.

In the above code, given lCondition_01 = .chkMonth.value != 0 and lCondition_02 = !isblank(.cmbMonth.value), the ELSE clause would execute when:
A. lCondition_01 == .F. and lCondition_02 == .F.
B. lCondition_01 == .T. and lCondition_02 == .F.
C. lCondition_01 == .F. and lCondition_02 == .T.
... and not just when A is satisfied. Which if this was done in one of our Math subjects (Automata-related) back in college will be the only basis for the output.

The cFileName line has been weeded out in comments just for the sake of this post. It has been my practice to save and export some filtered queries ('native Foxpro filter' and SQL queries) generated by the program to an .xls file.


Disclaimers are for castrated EARTHLINGS.
Powered: GREYMatter | GM-RSS

 

 
 
 
 

 

foxpro.main
foxpro.archives
richardbase.home

articles
downloads
snippets
utilities
knowledgebase.links
website.links

outpost.forum
the.site
the.catalyst
pixelcatalyst.lair

rss.feeds

February 2004
SMTWTFS
   1234
567891011
12131415161718
19202122232425
26272829   
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004





GEEK count:
visitors since the aliens rebooted the counter last 02.23.2006 (was around 33,000++ before the alien intrusion | SINCE: 02.26.2004)