[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
[sqr-users] Fetching value from 2-Dim. Array
Hi,
I'm trying to write a SQR report. I'm facing an error in fetching avalue from
a 2- dimensional array.
Attahced is the peice of code from this report.
The variable #count is used to get the second dimension from the Array.
I'm trying to fetch the value of an element (0, #count) from the array. When I
try to do this inside the begin-select, the value is properly fetched.
When I try to print the value of Array element, I'm inable to get the element .
It always prints the value of (0,0) , inspite of the fact that #count is 250.
this means it should print the value of (0,#count), where #count between 0 and
max .
All inputs in this regard would be very helpful.
thanks in advance.
Sudeep
begin-procedure STDDetermineWE($StartDate,$EndDate,:#count)
create-array name=WeekEndingArray size = 2
field=WeekEnding:char:300='No Data'
field=Amount:number:300=0
if $StartDate >= $EndDate
!No weekending dates within the selected range.
else
let #count = 0
begin-select
clndr_dte
day_of_wk_nbr
clndr_day_of_mth_nbr
clndr_mth_dscr
clndr_yr_nbr
let $clndr_day_of_mth_nbr = &clndr_day_of_mth_nbr
let $clndr_yr_nbr = &clndr_yr_nbr
if &day_of_wk_nbr = 1
let $DateValue = $clndr_day_of_mth_nbr ||
substr(&clndr_mth_dscr,1,3) || $clndr_yr_nbr
put $DateValue into WeekEndingArray(0) WeekEnding(#count)
put 100 into WeekEndingArray(1) Amount(#count)
get $a from WeekEndingArray(0) WeekEnding(#count)
get #b from WeekEndingArray(1) Amount(#count)
print 'Last weekend' (+1,1)
print $a (,+5)
print 'Amount' (+1,1)
print #b (,+5)
let #count = #count + 1
end-if
from
time_sv
where
((clndr_dte > $StartDate) AND (clndr_dte < $EndDate)) OR
(clndr_dte = $StartDate) OR
(clndr_dte = $EndDate)
end-select
end-if
print 'count' (+1,1)
print #count (,+5)
while (#count - 1) > 0
let $we = WeekEndingArray.WeekEnding(0,#count-1)
let #amt = WeekEndingArray.Amount(1,#count-1)
print 'Weekend' (+1,1)
print $we (,+5)
print 'Amount' (+1,1)
print #amt (,+5)
let #count = #count -1
end-while
end-procedure
--
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users