Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Count
Message
From
14/05/2004 12:49:52
 
 
To
14/05/2004 08:11:39
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Re: Count
Miscellaneous
Thread ID:
00904014
Message ID:
00904132
Views:
25
Mohammed, That sample is just first that comes to me in my mind. I am sure that there is a way for better optimise
CLOSE ALL
DIMENSION c_name[12]
c_name[1]  = " (1)  jan"
c_name[2]  = " (2)  feb"
c_name[3]  = " (3)  march"
c_name[4]  = " (4)  april"
c_name[5]  = " (5)  may"
c_name[6]  = " (6)  june"
c_name[7]  = " (7)  july"
c_name[8]  = " (8)  august"
c_name[9]  = " (9)  sept"
c_name[10] = " (10) oct"
c_name[11] = " (11) nov"
c_name[12] = " (12) dec"

FOR asd = 1 TO 12
    f_name = "month"+ALLTRIM(STR(asd,2))
    SELECT 0
    USE (f_name) EXCLUSIVE
    INDEX ON No TAG (f_name) && IF You have order just change that line with SET ORDER TO &f_name
NEXT

SELECT 0
USE tax1 EXCL
ZAP
SELECT 0
USE mstr
m.no=no
m.nam=nam
m.nam2=nam2
m.nam3=nam3
m.nam4=nam4

DO WHILE .NOT. EOF()
   FOR asd = 1 TO 12
       f_name = "month"+ALLTRIM(STR(asd,2))
       SELECT (f_name)
       SEEK m.No
       IF FOUND()
          DO APP1 WITH asd
       ENDIF
    NEXT
    SELECT Mstr
    SKIP
    m.no=no
    m.nam=nam
    m.nam2=nam2
    m.nam3=nam3
    m.nam4=nam4
ENDDO

PROCEDURE APP1(no_month)
    SCATTER MEMVAR
    ? no,nettot
    SELECT Tax1
    APPEND BLANK
    GATHER MEMVAR
    REPLACE MONTHNAM WITH c_name[no_month],;
            montNO   WITH no_month

RETURN
By the way it is not a good idea to name the variables as a fields of some table, just because sometime you might forget to put m. prefix & you'll receive some strange results.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform