General information
Category:
Coding, syntax & commands
I don't know if this helps but I dynamically expand my array as needed. Here is the code: for t3 = 1 to b3
if alltrim(a__gen2(t3,1)) <> alltrim(hc33)
SELECT Service.s_v_no, Service.s_curr_mile, Service.s_orddate FROM fleet!service;
WHERE Service.sv_sup == a3 and Service.sv_mileage <> 0 and Service.s_v_no == hc33 ;
and s_orddate between fd and td order by Service.s_v_no, ;
Service.s_orddate, S_curr_mile into array a__gen5
begmile = a__gen5(1,2)
a5_len = alen(a__gen5)/3
release a__gen5
hc33 = alltrim(a__gen2(t3,1))
d3 = d3 + 1
if third_sw = .t. && control break sup
a__gen3(d3,1) = a__gen2(t3-1,3) && sup
third_sw = .f.
else
dimension a__gen3(alen(a__gen3, 1) + 1, alen(a__gen3, 2)) &&increase array by 1 row
a__gen3(d3,1) = '' && blank
endif
a__gen3(d3,2) = a__gen2(t3-1,1) && vno
a__gen3(d3,3) = begmile && beginning mile
a__gen3(d3,4) = a__gen2(t3-1,4) && ending mile
a__gen3(d3,5) = a__gen2(t3-1,4) - begmile && total mileage
nd = {}
nd = td - fd
a__gen3(d3,6) = a__gen3(d3,5)/nd*30
&&& a__gen3(d3,6) = a__gen3(d3,5)/a5_len && average per month
a__gen3(d3,7) = a__gen2(t3-1,6) && unit
a__gen3(d3,8) = fd && from date
a__gen3(d3,9) = td && to date
endif
endfor
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only