Graham Monk
2008-09-24 21:43:25 UTC
I have spent the past 18 months writing an app that has been on general
release for a few months now and may have to be withdrawn due to the number
Memory Access Violation I am getting. So I am of the option that the way in
which I am coding things could be at the heart of it.
I use a lot of look ups and when I clear a row I turn off the LookUps first
then use a generic routine to clear the row to its initial values (zeros,
blanks, false, etc. depending on type) and turn the LookUps back on. This
works fine for one or more rows then eventually MAVs on the 'return'
statement of the cancelLookUps. Code to do this exists in lots of places
throughout the app and about half are OK and the rest MAV. Does anyone have
any suggestions please? I also get a log of MAVs from me drag and drop code
that moves lines about in a single row set where the same cancelLookUp and
setLookUp routines are called.
DataModule code:
function qItems_onOpen
this.rowset.setLookUps = class::rsItems_setLookUps
this.rowset.cancelLookUps = class::rsItems_cancelLookUps
this.rowset.setLookUps()
return
function rsItems_setLookUps
this.fields['Item_File_No'].lookupSQL = [select File_No, Short_Name
from File_List]
return
function rsItems_cancelLookUps
this.fields['Item_File_No'].lookupSQL = null
return << MAV here!
Regards,
Graham
release for a few months now and may have to be withdrawn due to the number
Memory Access Violation I am getting. So I am of the option that the way in
which I am coding things could be at the heart of it.
I use a lot of look ups and when I clear a row I turn off the LookUps first
then use a generic routine to clear the row to its initial values (zeros,
blanks, false, etc. depending on type) and turn the LookUps back on. This
works fine for one or more rows then eventually MAVs on the 'return'
statement of the cancelLookUps. Code to do this exists in lots of places
throughout the app and about half are OK and the rest MAV. Does anyone have
any suggestions please? I also get a log of MAVs from me drag and drop code
that moves lines about in a single row set where the same cancelLookUp and
setLookUp routines are called.
DataModule code:
function qItems_onOpen
this.rowset.setLookUps = class::rsItems_setLookUps
this.rowset.cancelLookUps = class::rsItems_cancelLookUps
this.rowset.setLookUps()
return
function rsItems_setLookUps
this.fields['Item_File_No'].lookupSQL = [select File_No, Short_Name
from File_List]
return
function rsItems_cancelLookUps
this.fields['Item_File_No'].lookupSQL = null
return << MAV here!
Regards,
Graham