I4Gl HELP
Posted in 1998
Hi Family,
I am new in I4GL world.. Our 4GL version is 4.10 . I know it too old.. For
that reason it might not work properly . I am facing a problem to make
query..The first query is giving perfect result.
But the second function which is also calling from first function is not
giving result properly. It is only showing 1 row.. That two function is
describing below...
The next function (shptdetl) is not working properly.. When I am using
shpt_view arry for storing
data & displaying data then it only stores last row.. But that all query is
returning perfect result.
I had seen it by making a report. If I try to run report with that
shpt_view array then it is not showing
perfect result. But when I define shpt_view as recrod then it works fine..
Is there any limitation for that I can't work with two array ????? If it is
there then how it could be overcome ???
Function cust_qry()
define max_row smallint
define ptr_shpt smallint
let k = 1
let max_row = 2000
open window newq at 3,5 with form "custdtl" attribute(border)
message "SEARCHING.........." attribute(reverse)
select distinct(awb),acct,,sd_prod,pcs,wght from xx
where acct matches cust_rec.act and orig = cust_rec.org and destmatches cust_rec.des and rte matches cust_rec.rte and sd_prod matches
cust_rec.p
and pu between cust_rec.fmdt and cust_rec.todt
order by acct into temp dip;
select acct,sum(wght)/10 wgt,count(*) shipment from dip
group by acct into temp san;
declare cust_ptr scroll cursor for
select acct,wgt,shipment from san
order by wgt desc
initialize cust_view[k].* to null
foreach cust_ptr into cust_view[k].*
let k = k + 1
if k > max_row
then
error "LIST EXCEED THE LIMITS"
exit foreach
end if
end foreach
message " "
if k = "0"
then
ERROR "NO RECORD FOUND....."
sleep 3
let int_flag = false
drop table dip
drop table sanelse
call set_count(k)
close cust_ptr
free cust_ptr
display array cust_view to s_cus.*
on key (F5)
let ptr_shpt = arr_curr()
call shptdetl(cust_view[ptr_shpt].acnt) ------- This Function is
not working perfect
on key (F11)
let int_flag = false
drop table dip
drop table san
exit display
end display
end if
End Function
Function shptdetl(account)
define account char(9)
define awb_ptr smallint
define j smallint
let j = 0
open window shpt_win at 7,40 with form "ship" attribute(border)
select distinct(awb),prod,pcs,wght from xx
where acct matches account and orig matches cust_rec.org and
dest matches cust_rec.des and prod matches cust_rec.p and rte matchescust_rec.rte and pu between cust_rec.fmdt and cust_rec.todt into temp dip1
select prod,sum(sd_wght)/10 wgt,count(*) spmnt from dip1
group by prod into temp san1;
declare shpt_ptr scroll cursor for
select sd_prod,wgt,spmnt from san1
order by prod
initialize shpt_view[j].* to null
foreach shpt_ptr into shpt_view[j].*
let j = j + 1
end foreach
call set_count(j)
close shpt_ptr
free shpt_ptr
display array shpt_view to s_shpt.* ---- IT IS ONLY DISPLAYINGLAST ROW.....
on key (F11)
let int_flag = false
drop table dip1
drop table san1
exit display
end display
close window shpt_win
End Function
Sorr for poor english..
Any advise will be highly appreciated..
Regards
Sandip Samanta