sushmasriram
asked on
application error R0002
The following is my powerscript code for a window that generates a report and a graph. I am getting an application error "Null object reference line 11 of w_downtime_reason R0002.
integer row_count, li_downtime
date ldt_begin_date, ldt_end_date, temp_date
string machine_num, setting
st_date_machine st_date_machine
open( w_calendar_range_response_ mach )
st_date_machine = message.powerobjectparm
tab_1.tabpage_1.dw_1.settr ansobject( sqlca )
tab_1.tabpage_1.dw_1.retri eve( ldt_begin_date, ldt_end_date, machine_num, row_count )
tab_1.tabpage_2.dw_2.settr ansobject( sqlca )
tab_1.tabpage_2.dw_2.retri eve( ldt_begin_date, ldt_end_date, machine_num )
ldt_begin_date = st_date_machine.st_begin_d ate
ldt_end_date = st_date_machine.st_end_dat e
machine_num = st_date_machine.st_machine _id
if machine_num <> '-1' then
if ldt_begin_date > 1949-01-01 and ldt_end_date > 1949-01-01 then
temp_date = ldt_begin_date
do while temp_date <= ldt_end_date
select sum(downtime_minutes)
into :li_downtime
from machine_downtime
where ( machine_id = :machine_num ) and
( capture_date = :temp_date );
if li_downtime > 10 then
row_count++
end if
temp_date =relativedate(temp_date,1)
loop
if ldt_begin_date = ldt_end_date then
tab_1.tabpage_2.dw_2.objec t.gr_1.tit le = machine_num + 'Downtime Category Report between' + string( ldt_begin_date, 'mm-dd-yyyy')
else
tab_1.tabpage_2.dw_2.objec t.gr_1.tit le = machine_num + 'Downtime Category Report ' + string( ldt_begin_date, 'mm-dd-yyyy') + ' and ' + string( ldt_end_date, 'mm-dd-yyyy')
end if
else
end if
end if
I am unable to figure out what the error is
Thanks
Sushma
integer row_count, li_downtime
date ldt_begin_date, ldt_end_date, temp_date
string machine_num, setting
st_date_machine st_date_machine
open( w_calendar_range_response_
st_date_machine = message.powerobjectparm
tab_1.tabpage_1.dw_1.settr
tab_1.tabpage_1.dw_1.retri
tab_1.tabpage_2.dw_2.settr
tab_1.tabpage_2.dw_2.retri
ldt_begin_date = st_date_machine.st_begin_d
ldt_end_date = st_date_machine.st_end_dat
machine_num = st_date_machine.st_machine
if machine_num <> '-1' then
if ldt_begin_date > 1949-01-01 and ldt_end_date > 1949-01-01 then
temp_date = ldt_begin_date
do while temp_date <= ldt_end_date
select sum(downtime_minutes)
into :li_downtime
from machine_downtime
where ( machine_id = :machine_num ) and
( capture_date = :temp_date );
if li_downtime > 10 then
row_count++
end if
temp_date =relativedate(temp_date,1)
loop
if ldt_begin_date = ldt_end_date then
tab_1.tabpage_2.dw_2.objec
else
tab_1.tabpage_2.dw_2.objec
end if
else
end if
end if
I am unable to figure out what the error is
Thanks
Sushma
Sorry, just one "open( w_calendar_range_response_ mach )" is needed !! o:)
ASKER
It helped thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
thanks :?
Hi,
sushma, looks like u did a big goof up here... the points were most deservingly for tr1l0b1t ...
he needs to be awarded the points... im sure its an error here...
sushma can u request the Page Editor to transfer the points to tr1l0b1t ...
Also,
tr1l0b1t u have any suggestion how this can b brought about... these points are absolutely not mine... i cant have it... please find a solution and post here...
Cheers,
Rosh
sushma, looks like u did a big goof up here... the points were most deservingly for tr1l0b1t ...
he needs to be awarded the points... im sure its an error here...
sushma can u request the Page Editor to transfer the points to tr1l0b1t ...
Also,
tr1l0b1t u have any suggestion how this can b brought about... these points are absolutely not mine... i cant have it... please find a solution and post here...
Cheers,
Rosh
I guess that sushma (if agree) might post the request, not me.
Anyway, thanks for your comments rosh !
Anyway, thanks for your comments rosh !
Change the name of the variable "st_date_machine" (it has the same name that its classname)
and check if the returned value from popup window is valid :
[...]
st_date_machine lst_date_machine
open( w_calendar_range_response_
open( w_calendar_range_response_
If IsValid(Message.PowerObjec
If ClassName(Message.PowerObj
lst_date_machine = message.powerobjectparm
Else
MessageBox("Error","Return
Return -1
End If
Else
MessageBox("Error","Nothin
Return -1
End If
// Then, assign values ...
ldt_begin_date = lst_date_machine.st_begin_
ldt_end_date = lst_date_machine.st_end_da
Hope it helps
Regards