Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Counter probelm
Message
From
22/06/2001 00:01:10
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australia
 
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Title:
Miscellaneous
Thread ID:
00522256
Message ID:
00522274
Views:
8
Hi Peter,

I know what the problem is. T_RCNT & T_ICNT are only being reset when the GROUP_NO changes and both T_RCNT and T_ICNT are greater than 0. Shouldn't you be reseting T_CNT AND T_RCNT if either of them were not 0, not if both were not 0?
IF (t_rcnt > 0) <B>OR</B> (t_icnt > 0)
   INSERT INTO rifile values(t_group, t_rcnt, t_icnt)
   t_rcnt = 0
   t_icnt = 0
ENDIF
You'll also need to put the code to Insert into RIFILE after the ENDSCAN, because the last GROUP_NO won't be written to RIFILE.

Hope this helps,
Gavin...

>The counter in the program incrementing instead of reseting itself.
>
>What I have is a cluster procedure that does not reset after the group of numbers is met.
>
>example
>group number = 12; four times and ira =I,R,N,I
>WHEN PROGRAM RUNS THROUGH THE RESULT IS T_RCNT =1 AND T_ICNT =2 BUT IT DOES NOT RESET IT SELF AFTER SO FOR THE NEXT ONE T_ICNT = 3
>GROUP NO = 13, TWO TIME AND IRA = I, N
>
>*)*****************************************************************************
>*) Name...........:
>*) File...........:
>*) Project........:
>*) Created........:
>*) Creator........: Peter Mayers
>*) Company........: Compu-Mail
>*) Copyright......: (c) Compu-Mail 2001
>*) Description....:
>*)
>*)
>*)
>*)
>*) Parameters.....: None
>*) Returns........: None
>*) Notes..........:
>*)
>*)
>*)
>**************************************************
>CLOSE DATABASES
>
>set default to getdir()
>
>SET TALK OFF
>SET SAFETY OFF
>
>***********************
>** declare variables
>**
>**---------------------
>t_line =0
>t_first =0
>t_sub =0
>t_sub1 =0
>t_mail =0
>t_group =0
>t_rec =0
>t_print =" "
>t_new_groupno = 0
>t_NeedsNewNbr = .f.
>t_old_groupno = 0
>dup = 0
>t_rcnt = 0
>t_icnt = 0
>
>USE rifile
>ZAP
>
>USE ? in 0 alias mailfile
>select mailfile
>
>
>scan
> if (mod(recno(), 500)) = 0
> wait window nowait transform(recno()/reccount()*100,"999.99%")
> endif
>
> SCATTER memvar
>
>
> IF m.group_no <> t_group
> IF (t_rcnt > 0) AND (t_icnt > 0)
> INSERT INTO rifile values(t_group, t_rcnt, t_icnt)
> t_rcnt = 0
> t_icnt = 0
> ENDIF
> t_group = m.group_no
> t_rec = 0
> t_NeedsNewNbr = .f.
> IF m.ira = "R"
> t_rcnt= t_rcnt + 1
> ELSE
> IF m.ira = "I"
> t_icnt= t_icnt + 1
> ENDIF
> ENDIF
> ELSE
>
> IF m.ira = "R"
> t_rcnt= t_rcnt + 1
> ELSE
> IF m.ira = "I"
> t_icnt= t_icnt + 1
> ENDIF
> ENDIF
>
> ENDIF
>
>
> GATHER memvar
>
>ENDSCAN
>close all
>
>
>Thanks
>
>peter
Previous
Reply
Map
View

Click here to load this message in the networking platform