PRINT only generates the results the first time?
Jeremy Anderson
jeremy at plunketts.net
Tue Aug 17 08:30:00 PDT 2004
I've been watching this code in the debugger, and it executes the loop
every time.
But only prints out once per record. As you'll see from looking at the
code, "cr" gets incremented each time we go through the loop. On my
output form, I'm printing "*cr of *11" , and the form that gets printed
will say "1 of 4" or "1 of 3", depending on the value in field 11
(number of blank TQIs requested).
I'm stumped, and hoping someone can lend me a clue. I would suspect that
my printer is gobbling requests, but if I set "video" as my default
printer, it still only shows the first TQI and none of the subsequent ones.
Jeremy
Here's the output table:
1 ------- - - - - - - - - - - - - - - - -
chkblnk■ If: 'verify that this is indeed a request for a blank TQI ■
Then: ' these will always have a blank field 7 and 8 ■
2 ------- - - - - - - - - - - - - - - - -
■ If: 7 ne "" OR 8 ne "" ■
Then: end; ■
3 ------- - - - - - - - - - - - - - - - -
■ If: 12 eq "Y" ■
Then: end; 'this TQI request has already been printed' ■
4 ------- - - - - - - - - - - - - - - - -
■ If: 'Record data on this output request in the Log file ■
Then: lookup fpl = tFileproLog r=free -n ■
5 ------- - - - - - - - - - - - - - - - -
■ If: not fpl ■
Then: goto dateck ■
6 ------- - - - - - - - - - - - - - - - -
dateck■ If: ■
Then: fpl(1) = "Master_lists"; fpl(2) = @FN; fpl(3) = @TD; fpl(4) = @ID
7 ------- - - - - - - - - - - - - - - - -
■ If: 'month is recorded in field 6. ■
Then: hg=6; ■
8 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: hn(8,date) = mid(hg,"1","3") & "01" & mid(hg,"3","3") ■
9 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: ho(10,mdyy/) = hn ■
10 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: hk(6,.0,g) = mid(ho,"7","4") & mid(ho,"1","2") ■
11 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: hi(9,MON) = mid(hg,"1","2"); hj(15,,g) = hi < mid(hg,"4","2") ■
12 ------- - - - - - - - - - - - - - - - -
getsupe■ If: ' get the supervisor's name ■
Then: lookup supename = em2 k=9 i=3 -nx ■
13 ------- - - - - - - - - - - - - - - - -
■ If: not supename ■
Then: zy="_______________________ "; goto entloop ■
14 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: zy=supename(6) < supename(7) ■
15 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: close supename; ■
16 ------- - - - - - - - - - - - - - - - -
entloop■ If: ' we might have to do multiple blank TQIs, so we're about ■
Then: ' to enter a loop. We'll check what field 11 is, and make ■
17 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: cr(3,.0,g) = "1"; ■
18 ------- - - - - - - - - - - - - - - - -
loop ■ If: ■
Then: ■
19 ------- - - - - - - - - - - - - - - - -
■ If: cr gt 11 ■
Then: goto finish ■
20 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: gosub output ■
21 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: cr=cr+"1"; show "@looping"; goto loop ■
22 ------- - - - - - - - - - - - - - - - -
finish ■ If: ■
Then: 12="Y"; end ■
23 ------- - - - - - - - - - - - - - - - -
output ■ If: ■
Then: ■
24 ------- - - - - - - - - - - - - - - - -
■ If: ' next few lines go into invnos (invoice numbers) ■
Then: ' and grab the next available invoice number, making sure it's an ■
25 ------- - - - - - - - - - - - - - - - -
■ If: ' unused number. Start at 999999, go back until you find a used ■
Then: ' invoice number, then add 1 to that, and put the record number in>
26 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: in(6,.0,g) = "999999" ■
27 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: lookup invnos k=in i=a -el ■
28 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: in = invnos(1); ir(6,.0,g) = invnos(@RN) ■
29 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: in = in + "1"; he(7,) = mid(in,"1","3") & "-" & mid(in,"4","3") ■
30 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: hf(16,) = hj ■
─
31 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: lookup rec = NewSerRec r=free -e ■
32 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: rec(1) = in; rec(3) = "33760"; rec(10) = 8; rec(13) = hk;
33 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: rec(14) = "1"; rec(15) = 3; rec(17) = "Q"; rec(18) = 10;
34 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: lookup invnos r=ir -e ■
35 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: invnos(1) = in ■
36 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: close invnos; hl = ""; hm = ""; ■
37 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: print ■
38 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: return ■
--
Jeremy Anderson jeremy (at) plunketts.net
IT Manager, Plunkett's Pest Control Author, Multitool Linux
More information about the Filepro-list
mailing list